mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 09:34:24 +01:00
onchaind:move some stuff around so we can call it
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user