From b937793555b24313d7c28800f5ccc77771c80bff Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 7 Mar 2017 11:33:24 +1030 Subject: [PATCH] lightningd/funding_tx: output number is 16 bit. It's actually always 0 or 1, but the spec wants 16 bits, so use that here. Signed-off-by: Rusty Russell --- lightningd/funding_tx.c | 2 +- lightningd/funding_tx.h | 2 +- lightningd/hsm/hsm.c | 2 +- lightningd/peer_control.c | 2 +- lightningd/test/run-funding_tx.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lightningd/funding_tx.c b/lightningd/funding_tx.c index b3a12ce97..4c504c745 100644 --- a/lightningd/funding_tx.c +++ b/lightningd/funding_tx.c @@ -13,7 +13,7 @@ #endif struct bitcoin_tx *funding_tx(const tal_t *ctx, - u32 *outnum, + u16 *outnum, const struct utxo **utxomap, u64 funding_satoshis, const struct pubkey *local_fundingkey, diff --git a/lightningd/funding_tx.h b/lightningd/funding_tx.h index 5784d333a..fa8dbbaae 100644 --- a/lightningd/funding_tx.h +++ b/lightningd/funding_tx.h @@ -33,7 +33,7 @@ struct utxo; * a special case because of the P2SH inputs. */ struct bitcoin_tx *funding_tx(const tal_t *ctx, - u32 *outnum, + u16 *outnum, const struct utxo **utxomap, u64 funding_satoshis, const struct pubkey *local_fundingkey, diff --git a/lightningd/hsm/hsm.c b/lightningd/hsm/hsm.c index 32fc182ca..8ce6c6677 100644 --- a/lightningd/hsm/hsm.c +++ b/lightningd/hsm/hsm.c @@ -365,7 +365,7 @@ static u8 *sign_funding_tx(const tal_t *ctx, const u8 *data) struct bitcoin_tx *tx; u8 *wscript, *msg_out; secp256k1_ecdsa_signature *sig; - u32 outnum; + u16 outnum; size_t i; struct pubkey changekey; diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 1642f35ac..da8e68dc5 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -562,7 +562,7 @@ static void opening_gen_funding(struct subdaemon *opening, const u8 *resp, { u8 *msg; struct sha256_double txid; - u32 outnum; + u16 outnum; struct pubkey changekey; peer_set_condition(fc->peer, "Created funding transaction for channel"); diff --git a/lightningd/test/run-funding_tx.c b/lightningd/test/run-funding_tx.c index b883f2887..4143c4508 100644 --- a/lightningd/test/run-funding_tx.c +++ b/lightningd/test/run-funding_tx.c @@ -49,7 +49,7 @@ int main(void) struct utxo utxo; const struct utxo **utxomap = tal_arr(tmpctx, const struct utxo *, 1); u64 funding_satoshis; - u32 funding_outnum; + u16 funding_outnum; u8 *subscript; secp256k1_ecdsa_signature sig;