From ae8b459932a34c55d033ded4afbef05f08aa8511 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 26 Jul 2018 16:57:26 +0930 Subject: [PATCH] onchaind: tell wallet when we see our revoked commitment tx `to_remote` output Without this, the wallet won't know how to spend it. Fixes: #1738 Signed-off-by: Rusty Russell --- onchaind/onchain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/onchaind/onchain.c b/onchaind/onchain.c index 6c865e286..f46c43eb7 100644 --- a/onchaind/onchain.c +++ b/onchaind/onchain.c @@ -1832,6 +1832,14 @@ static void handle_their_cheat(const struct bitcoin_tx *tx, OUTPUT_TO_US, NULL, NULL, NULL); ignore_output(out); script[LOCAL] = NULL; + + /* Tell the master that it will want to add + * this UTXO to its outputs */ + wire_sync_write(REQ_FD, towire_onchain_add_utxo( + tmpctx, txid, i, + remote_per_commitment_point, + tx->output[i].amount, + tx_blockheight)); continue; } if (script[REMOTE]