chat_core_connect_auto: set peer_node_id on ETCP_CONN

Without peer_node_id, incoming INIT handler can't find the existing
outbound connection, creates a new one, and fails on insert_link collision.
This commit is contained in:
Evgeny committed 2026-07-15 10:51:53 +03:00
1 parent fc6a873b5c
commit a8164baf41
1 file changed
+1
+1
View File
@@ -1050,6 +1050,7 @@ void chat_core_connect_auto(uint64_t node_id,
}
sc_init_ctx(&conn->crypto_ctx, &g_cc.inst->my_keys);
sc_set_peer_public_key(&conn->crypto_ctx, pubkey, 0);
conn->peer_node_id = node_id;
struct ca_ctx* pctx = u_calloc(1, sizeof(struct ca_ctx));
if (!pctx) { etcp_connection_close(conn); pst->conns[i] = NULL; pst->timers[i] = NULL; pst->pending_count--; continue; }