mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
chaintopology: reduce how far back we start on testnet.
When initially reading the blockchain, we start 100 back from the current block, or at the first block with a funding transaction, whichever is earlier. This slows testing slightly, so use whatever the "forever" value is (10 on testnet, still 100 on mainnet). make check -j12 times: Before: 7m52.005s After: 6m31.896s Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
ce96812ef0
commit
716da21f85
@ -483,10 +483,11 @@ static void get_init_blockhash(struct lightningd_state *dstate, u32 blockcount,
|
||||
u32 start;
|
||||
struct peer *peer;
|
||||
|
||||
if (blockcount < 100)
|
||||
/* Start back before any reasonable forks. */
|
||||
if (blockcount < dstate->config.forever_confirms)
|
||||
start = 0;
|
||||
else
|
||||
start = blockcount - 100;
|
||||
start = blockcount - dstate->config.forever_confirms;
|
||||
|
||||
/* If loaded from database, go back to earliest possible peer anchor. */
|
||||
list_for_each(&dstate->peers, peer, list) {
|
||||
|
Loading…
Reference in New Issue
Block a user