mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
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:
parent
944439853a
commit
187e493ab8
@ -67,7 +67,7 @@ static void got_filteredblock(struct bitcoind *bitcoind,
|
|||||||
struct bitcoin_tx_output txo;
|
struct bitcoin_tx_output txo;
|
||||||
|
|
||||||
/* Only fill in blocks that we are not going to scan later. */
|
/* 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);
|
wallet_filteredblock_add(bitcoind->ld->wallet, fb);
|
||||||
|
|
||||||
u32 outnum = short_channel_id_outnum(scid);
|
u32 outnum = short_channel_id_outnum(scid);
|
||||||
|
@ -1344,9 +1344,8 @@ def test_gossip_announce_invalid_block(node_factory, bitcoind):
|
|||||||
|
|
||||||
# Make sure it's OK once it's caught up.
|
# Make sure it's OK once it's caught up.
|
||||||
sync_blockheight(bitcoind, [l1])
|
sync_blockheight(bitcoind, [l1])
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(strict=True)
|
|
||||||
def test_gossip_announce_unknown_block(node_factory, bitcoind):
|
def test_gossip_announce_unknown_block(node_factory, bitcoind):
|
||||||
"""Don't backfill the future!
|
"""Don't backfill the future!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user