From 187e493ab814d6a2444d7d2de5656a694446ad9d Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 19 Aug 2019 18:53:40 +0200 Subject: [PATCH] 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 --- lightningd/gossip_control.c | 2 +- tests/test_gossip.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index 00a2dee39..ab256d296 100644 --- a/lightningd/gossip_control.c +++ b/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); diff --git a/tests/test_gossip.py b/tests/test_gossip.py index cff2b2938..06fa44085 100644 --- a/tests/test_gossip.py +++ b/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!