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 <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2019-08-19 18:53:40 +02:00 committed by Rusty Russell
parent 944439853a
commit 187e493ab8
2 changed files with 2 additions and 3 deletions

View File

@ -67,7 +67,7 @@ static void got_filteredblock(struct bitcoind *bitcoind,
struct bitcoin_tx_output txo;
/* Only fill in blocks that we are not going to scan later. */
if (bitcoind->ld->topology->min_blockheight > fb->height)
if (bitcoind->ld->topology->max_blockheight > fb->height)
wallet_filteredblock_add(bitcoind->ld->wallet, fb);
u32 outnum = short_channel_id_outnum(scid);

View File

@ -1346,7 +1346,6 @@ def test_gossip_announce_invalid_block(node_factory, bitcoind):
sync_blockheight(bitcoind, [l1])
@pytest.mark.xfail(strict=True)
def test_gossip_announce_unknown_block(node_factory, bitcoind):
"""Don't backfill the future!