Skip to content

Commit

Permalink
chaintopology: Add missing block_map_del.
Browse files Browse the repository at this point in the history
We would `block_map_add` inside `add_tip`, but we never
`block_map_del` inside `remove_tip`, which is dangerous as
we actually `tal_free` the block inside `remove_tip`.

Our CI did not reliably trap this problem since block
hashes are random and rerunning the `test_blockchaintrack`
often passed spuriously.
  • Loading branch information
ZmnSCPxj authored and rustyrussell committed Mar 16, 2018
1 parent 39d8f64 commit 7bbc194
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lightningd/chaintopology.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ static void remove_tip(struct chain_topology *topo)
txwatch_fire(topo, b->txs[i], 0);

wallet_block_remove(topo->wallet, b);
block_map_del(&topo->block_map, b);
tal_free(b);
}

Expand Down

0 comments on commit 7bbc194

Please sign in to comment.