From 605358f2a344534fdeb9136a2193b6b2cf68534c Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 28 May 2019 18:09:30 +0200 Subject: [PATCH] onchaind: Have onchaind annotate unilateral, cheat and mutual closes onchaind knows best, no need to guess outside. Signed-off-by: Christian Decker --- onchaind/onchaind.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index 5c52851e5..ff495438b 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -1396,6 +1396,7 @@ static void handle_mutual_close(const struct bitcoin_txid *txid, struct tracked_output **outs) { init_reply("Tracking mutual close transaction"); + onchain_transaction_annotate(txid, TX_CHANNEL_CLOSE); /* BOLT #5: * @@ -1691,6 +1692,7 @@ static void handle_our_unilateral(const struct bitcoin_tx *tx, size_t i; init_reply("Tracking our own unilateral close"); + onchain_transaction_annotate(txid, TX_CHANNEL_UNILATERAL); /* BOLT #5: * @@ -1969,6 +1971,7 @@ static void handle_their_cheat(const struct bitcoin_tx *tx, size_t i; init_reply("Tracking their illegal close: taking all funds"); + onchain_transaction_annotate(txid, TX_CHANNEL_UNILATERAL | TX_CHANNEL_CHEAT | TX_THEIRS); /* BOLT #5: * @@ -2189,6 +2192,7 @@ static void handle_their_unilateral(const struct bitcoin_tx *tx, size_t i; init_reply("Tracking their unilateral close"); + onchain_transaction_annotate(txid, TX_CHANNEL_UNILATERAL | TX_THEIRS); /* HSM can't derive this. */ remote_per_commitment_point = this_remote_per_commitment_point; @@ -2403,6 +2407,8 @@ static void handle_unknown_commitment(const struct bitcoin_tx *tx, int to_us_output = -1; u8 *local_script; + onchain_transaction_annotate(txid, TX_CHANNEL_UNILATERAL | TX_THEIRS); + resolved_by_other(outs[0], txid, UNKNOWN_UNILATERAL); if (!possible_remote_per_commitment_point)