Skip to content

Commit

Permalink
bitcoin/tx: remove unused pull_bitcoin_tx_onto.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Feb 8, 2018
1 parent 674a2c7 commit 9a6c36a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
12 changes: 3 additions & 9 deletions bitcoin/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,13 @@ static void pull_witness(struct bitcoin_tx_input *inputs, size_t i,
}
}

struct bitcoin_tx *pull_bitcoin_tx_onto(const tal_t *ctx, const u8 **cursor,
size_t *max, struct bitcoin_tx *tx)
struct bitcoin_tx *pull_bitcoin_tx(const tal_t *ctx, const u8 **cursor,
size_t *max)
{
size_t i;
u64 count;
u8 flag = 0;
struct bitcoin_tx *tx = tal(ctx, struct bitcoin_tx);

tx->version = pull_le32(cursor, max);
count = pull_length(cursor, max, 32 + 4 + 4 + 1);
Expand Down Expand Up @@ -422,13 +423,6 @@ struct bitcoin_tx *pull_bitcoin_tx_onto(const tal_t *ctx, const u8 **cursor,
return tx;
}

struct bitcoin_tx *pull_bitcoin_tx(const tal_t *ctx,
const u8 **cursor, size_t *max)
{
struct bitcoin_tx *tx = tal(ctx, struct bitcoin_tx);
return pull_bitcoin_tx_onto(ctx, cursor, max, tx);
}

struct bitcoin_tx *bitcoin_tx_from_hex(const tal_t *ctx, const char *hex,
size_t hexlen)
{
Expand Down
14 changes: 0 additions & 14 deletions bitcoin/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,4 @@ bool bitcoin_txid_to_hex(const struct bitcoin_txid *txid,
struct bitcoin_tx *pull_bitcoin_tx(const tal_t *ctx,
const u8 **cursor, size_t *max);

/**
* pull_bitcoin_tx_onto - De-serialize a bitcoin tx into tx
*
* Like pull_bitcoin_tx, but skips the allocation of tx. Used by the
* wire implementation where the caller allocates, and the callee only
* fills in values.
*
* @ctx: Allocation context
* @cursor: buffer to read from
* @max: Buffer size left to read
* @tx (out): Destination transaction
*/
struct bitcoin_tx *pull_bitcoin_tx_onto(const tal_t *ctx, const u8 **cursor,
size_t *max, struct bitcoin_tx *tx);
#endif /* LIGHTNING_BITCOIN_TX_H */
1 change: 0 additions & 1 deletion wire/fromwire.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ void derive_channel_id(struct channel_id *channel_id,
channel_id->id[sizeof(*channel_id)-1] ^= txout;
}

/* FIXME: Simply rename pull_bitcoin_tx, remove pull_bitcoin_tx_onto */
struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx,
const u8 **cursor, size_t *max)
{
Expand Down

0 comments on commit 9a6c36a

Please sign in to comment.