Skip to content

Commit

Permalink
onchaind:move some stuff around so we can call it
Browse files Browse the repository at this point in the history
  • Loading branch information
niftynei authored and rustyrussell committed Dec 27, 2021
1 parent ade2242 commit 07039fc
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions onchaind/onchaind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 07039fc

Please sign in to comment.