bitcoin/tx: pass struct amount_sat by copy.

This is the normal convention for this type; it makes using converters
a little easier.  See next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-08-21 13:22:44 +09:30
parent 2f1e116510
commit c9817b225b
10 changed files with 33 additions and 33 deletions

View File

@@ -175,7 +175,7 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
u8 *wscript = to_self_wscript(tmpctx, to_self_delay, keyset);
amount = amount_msat_to_sat_round_down(self_pay);
int pos = bitcoin_tx_add_output(
tx, scriptpubkey_p2wsh(tx, wscript), &amount);
tx, scriptpubkey_p2wsh(tx, wscript), amount);
assert(pos == n);
n++;
}
@@ -197,7 +197,7 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
amount = amount_msat_to_sat_round_down(other_pay);
int pos = bitcoin_tx_add_output(
tx, scriptpubkey_p2wpkh(tx, &keyset->other_payment_key),
&amount);
amount);
assert(pos == n);
n++;
}
@@ -236,7 +236,7 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
* * `txin[0]` script bytes: 0
*/
sequence = (0x80000000 | ((obscured_commitment_number>>24) & 0xFFFFFF));
bitcoin_tx_add_input(tx, funding_txid, funding_txout, sequence, &funding, NULL);
bitcoin_tx_add_input(tx, funding_txid, funding_txout, sequence, funding, NULL);
assert(bitcoin_tx_check(tx));