mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
openchannel2: may re-use rates
If more than one plugin calls `openchannel2`, the payload will get re-freshed/re-parsed.
This commit is contained in:
parent
00d3e3e492
commit
d3066ab7f9
1 changed files with 4 additions and 1 deletions
|
@ -745,7 +745,9 @@ openchannel2_hook_deserialize(struct openchannel2_payload *payload,
|
||||||
|
|
||||||
|
|
||||||
struct amount_msat fee_base, fee_max_base;
|
struct amount_msat fee_base, fee_max_base;
|
||||||
payload->rates = tal(payload, struct lease_rates);
|
/* deserialized may be called multiple times */
|
||||||
|
if (!payload->rates)
|
||||||
|
payload->rates = tal(payload, struct lease_rates);
|
||||||
err = json_scan(payload, buffer, toks,
|
err = json_scan(payload, buffer, toks,
|
||||||
"{lease_fee_base_msat:%"
|
"{lease_fee_base_msat:%"
|
||||||
",lease_fee_basis:%"
|
",lease_fee_basis:%"
|
||||||
|
@ -1880,6 +1882,7 @@ static void accepter_got_offer(struct subd *dualopend,
|
||||||
payload->accepter_funding = AMOUNT_SAT(0);
|
payload->accepter_funding = AMOUNT_SAT(0);
|
||||||
payload->our_shutdown_scriptpubkey = NULL;
|
payload->our_shutdown_scriptpubkey = NULL;
|
||||||
payload->peer_id = channel->peer->id;
|
payload->peer_id = channel->peer->id;
|
||||||
|
payload->rates = NULL;
|
||||||
payload->err_msg = NULL;
|
payload->err_msg = NULL;
|
||||||
|
|
||||||
if (!fromwire_dualopend_got_offer(payload, msg,
|
if (!fromwire_dualopend_got_offer(payload, msg,
|
||||||
|
|
Loading…
Add table
Reference in a new issue