From 90c786f61beef3086834e66f445f5721808a3c85 Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Fri, 4 Oct 2024 16:01:26 -0400 Subject: [PATCH] channeld: Move tx lookup function up This function needs to be used earlier in the file so it is moved vertically up. Chanelog-None --- channeld/channeld.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index 5ba1ca65f..e5ad934ad 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -3664,6 +3664,23 @@ static void update_hsmd_with_splice(struct peer *peer, struct inflight *inflight tal_hex(tmpctx, msg)); } +static struct bitcoin_tx *bitcoin_tx_from_txid(struct peer *peer, + struct bitcoin_txid txid) +{ + u8 *msg; + struct bitcoin_tx *tx = NULL; + + msg = towire_channeld_splice_lookup_tx(NULL, &txid); + + msg = master_wait_sync_reply(tmpctx, peer, take(msg), + WIRE_CHANNELD_SPLICE_LOOKUP_TX_RESULT); + + if (!fromwire_channeld_splice_lookup_tx_result(tmpctx, msg, &tx)) + master_badmsg(WIRE_CHANNELD_SPLICE_LOOKUP_TX_RESULT, msg); + + return tx; +} + /* ACCEPTER side of the splice. Here we handle all the accepter's steps for the * splice. Since the channel must be in STFU mode we block the daemon here until * the splice is finished or aborted. */ @@ -3814,23 +3831,6 @@ static void splice_accepter(struct peer *peer, const u8 *inmsg) resume_splice_negotiation(peer, true, true, true, true); } -static struct bitcoin_tx *bitcoin_tx_from_txid(struct peer *peer, - struct bitcoin_txid txid) -{ - u8 *msg; - struct bitcoin_tx *tx = NULL; - - msg = towire_channeld_splice_lookup_tx(NULL, &txid); - - msg = master_wait_sync_reply(tmpctx, peer, take(msg), - WIRE_CHANNELD_SPLICE_LOOKUP_TX_RESULT); - - if (!fromwire_channeld_splice_lookup_tx_result(tmpctx, msg, &tx)) - master_badmsg(WIRE_CHANNELD_SPLICE_LOOKUP_TX_RESULT, msg); - - return tx; -} - /* splice_initiator runs when splice_ack is received by the other side. It * handles the initial splice creation while callbacks will handle later * stages. */