From 07039fc2b4a47d7d5e8f0806ee35d491d92bda3b Mon Sep 17 00:00:00 2001 From: niftynei Date: Wed, 1 Dec 2021 09:39:40 -0600 Subject: [PATCH] onchaind:move some stuff around so we can call it --- onchaind/onchaind.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/onchaind/onchaind.c b/onchaind/onchaind.c index 204a42405..80e3fc429 100644 --- a/onchaind/onchaind.c +++ b/onchaind/onchaind.c @@ -127,6 +127,26 @@ struct tracked_output { struct sha256 payment_hash; }; +static const char *tx_type_name(enum tx_type tx_type) +{ + size_t i; + + for (i = 0; enum_tx_type_names[i].name; i++) + if (enum_tx_type_names[i].v == tx_type) + return enum_tx_type_names[i].name; + return "unknown"; +} + +static const char *output_type_name(enum output_type output_type) +{ + size_t i; + + for (i = 0; enum_output_type_names[i].name; i++) + if (enum_output_type_names[i].v == output_type) + return enum_output_type_names[i].name; + return "unknown"; +} + /* helper to compare output script with our tal'd script */ static bool wally_tx_output_scripteq(const struct wally_tx_output *out, const u8 *script) @@ -456,26 +476,6 @@ static void set_htlc_success_fee(struct bitcoin_tx *tx, tal_hex(tmpctx, wscript)); } -static const char *tx_type_name(enum tx_type tx_type) -{ - size_t i; - - for (i = 0; enum_tx_type_names[i].name; i++) - if (enum_tx_type_names[i].v == tx_type) - return enum_tx_type_names[i].name; - return "unknown"; -} - -static const char *output_type_name(enum output_type output_type) -{ - size_t i; - - for (i = 0; enum_output_type_names[i].name; i++) - if (enum_output_type_names[i].v == output_type) - return enum_output_type_names[i].name; - return "unknown"; -} - static u8 *delayed_payment_to_us(const tal_t *ctx, struct bitcoin_tx *tx, const u8 *wscript)