mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
onchaind: two minor tidyups.
Firstly, amount should not be `static`, so use a separate line to declare those (fee is static, as it's cached across calls). Secondly, new_tracked_output doesn't take(), it copies. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -493,7 +493,8 @@ static bool set_htlc_timeout_fee(struct bitcoin_tx *tx,
|
|||||||
const struct bitcoin_signature *remotesig,
|
const struct bitcoin_signature *remotesig,
|
||||||
const u8 *wscript)
|
const u8 *wscript)
|
||||||
{
|
{
|
||||||
static struct amount_sat amount, fee = AMOUNT_SAT_INIT(UINT64_MAX);
|
static struct amount_sat fee = AMOUNT_SAT_INIT(UINT64_MAX);
|
||||||
|
struct amount_sat amount;
|
||||||
struct amount_asset asset = bitcoin_tx_output_get_amount(tx, 0);
|
struct amount_asset asset = bitcoin_tx_output_get_amount(tx, 0);
|
||||||
size_t weight;
|
size_t weight;
|
||||||
|
|
||||||
@@ -541,7 +542,8 @@ static void set_htlc_success_fee(struct bitcoin_tx *tx,
|
|||||||
const struct bitcoin_signature *remotesig,
|
const struct bitcoin_signature *remotesig,
|
||||||
const u8 *wscript)
|
const u8 *wscript)
|
||||||
{
|
{
|
||||||
static struct amount_sat amt, fee = AMOUNT_SAT_INIT(UINT64_MAX);
|
static struct amount_sat fee = AMOUNT_SAT_INIT(UINT64_MAX);
|
||||||
|
struct amount_sat amt;
|
||||||
struct amount_asset asset;
|
struct amount_asset asset;
|
||||||
size_t weight;
|
size_t weight;
|
||||||
|
|
||||||
@@ -990,7 +992,7 @@ new_tracked_output(struct tracked_output ***outs,
|
|||||||
enum output_type output_type,
|
enum output_type output_type,
|
||||||
const struct htlc_stub *htlc,
|
const struct htlc_stub *htlc,
|
||||||
const u8 *wscript,
|
const u8 *wscript,
|
||||||
const struct bitcoin_signature *remote_htlc_sig TAKES)
|
const struct bitcoin_signature *remote_htlc_sig)
|
||||||
{
|
{
|
||||||
struct tracked_output *out = tal(*outs, struct tracked_output);
|
struct tracked_output *out = tal(*outs, struct tracked_output);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user