Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #212 from nayutaco/random-connect-time
Browse files Browse the repository at this point in the history
random connect time
  • Loading branch information
nayuta-ueno authored Feb 18, 2018
2 parents 999479b + 30c170c commit 4e9a618
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ucoind/monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ static bool funding_unspent(ln_self_t *self, uint32_t confm, void *p_db_param)
misc_bin2str(nodestr, p_node_id, UCOIN_SZ_PUBKEY);
sprintf(json, "{\"method\":\"connect\",\"params\":[\"%s\",\"%s\",%d]}", nodestr, ipaddr, anno.addr.port);
DBG_PRINTF("%s\n", json);

misc_msleep(10 + rand() % 2000); //双方が同時に接続しに行かないように時差を付ける(効果があるかは不明)
int retval = misc_sendjson(json, "127.0.0.1", cmd_json_get_port());
DBG_PRINTF("retval=%d\n", retval);
}
Expand Down

0 comments on commit 4e9a618

Please sign in to comment.