lightningd: trace JSON id prefixes through sendrawtx.

First, merge the _ahf_ and non-ahf interfaces.
Second, remove the always-NULL txs->cmd field.

Then, add optional id_prefix for bitcoind_sendrawx, so if it's
triggered by a command (e.g. "withdraw") it's shown correctly in logs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-09-13 06:49:11 +09:30
parent a9557d5194
commit ea7903f69a
16 changed files with 107 additions and 96 deletions

View File

@@ -1561,7 +1561,13 @@ static void send_funding_tx(struct channel *channel,
type_to_string(tmpctx, struct wally_tx, cs->wtx));
bitcoind_sendrawtx(ld->topology->bitcoind,
channel->open_attempt
? (channel->open_attempt->cmd
? channel->open_attempt->cmd->id
: NULL)
: NULL,
tal_hex(tmpctx, linearize_wtx(tmpctx, cs->wtx)),
false,
sendfunding_done, cs);
}