From 5188b14c7c34b5cc224307713b22ed1ee5046069 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 26 May 2016 15:25:24 +0930 Subject: [PATCH] daemon: fix unwatch anchor depth. We still need to watch the anchor output in this case: that's what makes us handle the commit transcction we broadcast. Signed-off-by: Rusty Russell --- daemon/peer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/peer.c b/daemon/peer.c index 8efe7cc25..a7ce598eb 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -1976,7 +1976,8 @@ void peer_unwatch_anchor_depth(struct peer *peer, enum state_input timeout) { assert(peer->anchor.watches); - peer->anchor.watches = tal_free(peer->anchor.watches); + assert(peer->anchor.watches->depthok == depthok); + peer->anchor.watches->depthok = INPUT_NONE; } uint64_t commit_tx_fee(const struct bitcoin_tx *commit, uint64_t anchor_satoshis)