Skip to content

Commit 187e493

Browse files
cdeckerrustyrussell
authored andcommitted
gossip: Stop backfilling the future
This was caused by us not checking against the max_blockheight, but rather the min_blockheight which can be negative with a newly created node. This is still safe since we check for duplicates anyway in `wallet_filteredblock_add`. Signed-off-by: Christian Decker <[email protected]>
1 parent 9444398 commit 187e493

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lightningd/gossip_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void got_filteredblock(struct bitcoind *bitcoind,
6767
struct bitcoin_tx_output txo;
6868

6969
/* Only fill in blocks that we are not going to scan later. */
70-
if (bitcoind->ld->topology->min_blockheight > fb->height)
70+
if (bitcoind->ld->topology->max_blockheight > fb->height)
7171
wallet_filteredblock_add(bitcoind->ld->wallet, fb);
7272

7373
u32 outnum = short_channel_id_outnum(scid);

tests/test_gossip.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,9 +1344,8 @@ def test_gossip_announce_invalid_block(node_factory, bitcoind):
13441344

13451345
# Make sure it's OK once it's caught up.
13461346
sync_blockheight(bitcoind, [l1])
1347-
13481347

1349-
@pytest.mark.xfail(strict=True)
1348+
13501349
def test_gossip_announce_unknown_block(node_factory, bitcoind):
13511350
"""Don't backfill the future!
13521351

0 commit comments

Comments
 (0)