mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
bitcoin: add fromwire/towire routines for bitcoin_outpoint.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
cce280400c
commit
67fc6e6267
13
bitcoin/tx.c
13
bitcoin/tx.c
@ -716,6 +716,19 @@ void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid)
|
||||
towire_sha256_double(pptr, &txid->shad);
|
||||
}
|
||||
|
||||
void towire_bitcoin_outpoint(u8 **pptr, const struct bitcoin_outpoint *outp)
|
||||
{
|
||||
towire_bitcoin_txid(pptr, &outp->txid);
|
||||
towire_u32(pptr, outp->n);
|
||||
}
|
||||
|
||||
void fromwire_bitcoin_outpoint(const u8 **cursor, size_t *max,
|
||||
struct bitcoin_outpoint *outp)
|
||||
{
|
||||
fromwire_bitcoin_txid(cursor, max, &outp->txid);
|
||||
outp->n = fromwire_u32(cursor, max);
|
||||
}
|
||||
|
||||
void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx)
|
||||
{
|
||||
u8 *lin = linearize_tx(tmpctx, tx);
|
||||
|
@ -254,6 +254,9 @@ void towire_bitcoin_txid(u8 **pptr, const struct bitcoin_txid *txid);
|
||||
void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx);
|
||||
void towire_bitcoin_tx_output(u8 **pptr, const struct bitcoin_tx_output *output);
|
||||
void towire_wally_tx(u8 **pptr, const struct wally_tx *wtx);
|
||||
void towire_bitcoin_outpoint(u8 **pptr, const struct bitcoin_outpoint *outp);
|
||||
void fromwire_bitcoin_outpoint(const u8 **cursor, size_t *max,
|
||||
struct bitcoin_outpoint *outp);
|
||||
|
||||
/* Various weights of transaction parts. */
|
||||
size_t bitcoin_tx_core_weight(size_t num_inputs, size_t num_outputs);
|
||||
|
Loading…
Reference in New Issue
Block a user