Browse Source

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>
pull/2938/head
Christian Decker 5 years ago
committed by Rusty Russell
parent
commit
187e493ab8
  1. 2
      lightningd/gossip_control.c
  2. 3
      tests/test_gossip.py

2
lightningd/gossip_control.c

@ -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);

3
tests/test_gossip.py

@ -1344,9 +1344,8 @@ def test_gossip_announce_invalid_block(node_factory, bitcoind):
# Make sure it's OK once it's caught up.
sync_blockheight(bitcoind, [l1])
@pytest.mark.xfail(strict=True)
def test_gossip_announce_unknown_block(node_factory, bitcoind):
"""Don't backfill the future!

Loading…
Cancel
Save