mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
onchaind:move some stuff around so we can call it
This commit is contained in:
parent
ade2242d14
commit
07039fc2b4
1 changed files with 20 additions and 20 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue