From e746e9c2026c3c964eadb496b65df1e87881e557 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 5 Jul 2019 14:27:01 +0930 Subject: [PATCH] onchaind: fix resolution detection of complex outputs. We shouldn't set out->resolved until we've actually resolved it. Signed-off-by: Rusty Russell --- onchaind/onchaind.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index cf9d567c4..b4c3c734c 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -612,8 +612,6 @@ static bool resolved_by_proposal(struct tracked_output *out, if (!out->proposal->tx) return false; - out->resolved = tal(out, struct resolution); - /* Our proposal can change as feerates change. Input * comparison (ignoring signatures) works pretty well. * @@ -628,6 +626,7 @@ static bool resolved_by_proposal(struct tracked_output *out, return false; } + out->resolved = tal(out, struct resolution); bitcoin_txid(tx, &out->resolved->txid); status_trace("Resolved %s/%s by our proposal %s (%s)", tx_type_name(out->tx_type),