mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
openingd: Wire reserve
value through to openingd
This commit is contained in:
parent
9a97f8c154
commit
8d6423389a
@ -711,7 +711,8 @@ openchannel_hook_final(struct openchannel_hook_payload *payload STEALS)
|
|||||||
subd_send_msg(openingd,
|
subd_send_msg(openingd,
|
||||||
take(towire_openingd_got_offer_reply(NULL, errmsg,
|
take(towire_openingd_got_offer_reply(NULL, errmsg,
|
||||||
our_upfront_shutdown_script,
|
our_upfront_shutdown_script,
|
||||||
upfront_shutdown_script_wallet_index)));
|
upfront_shutdown_script_wallet_index,
|
||||||
|
payload->uc->reserve)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -814,6 +814,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
|
|||||||
struct penalty_base *pbase;
|
struct penalty_base *pbase;
|
||||||
struct tlv_accept_channel_tlvs *accept_tlvs;
|
struct tlv_accept_channel_tlvs *accept_tlvs;
|
||||||
struct tlv_open_channel_tlvs *open_tlvs;
|
struct tlv_open_channel_tlvs *open_tlvs;
|
||||||
|
struct amount_sat *reserve;
|
||||||
|
|
||||||
/* BOLT #2:
|
/* BOLT #2:
|
||||||
*
|
*
|
||||||
@ -1013,8 +1014,9 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
|
|||||||
/* We don't allocate off tmpctx, because that's freed inside
|
/* We don't allocate off tmpctx, because that's freed inside
|
||||||
* opening_negotiate_msg */
|
* opening_negotiate_msg */
|
||||||
if (!fromwire_openingd_got_offer_reply(state, msg, &err_reason,
|
if (!fromwire_openingd_got_offer_reply(state, msg, &err_reason,
|
||||||
&state->upfront_shutdown_script[LOCAL],
|
&state->upfront_shutdown_script[LOCAL],
|
||||||
&state->local_upfront_shutdown_wallet_index))
|
&state->local_upfront_shutdown_wallet_index,
|
||||||
|
&reserve))
|
||||||
master_badmsg(WIRE_OPENINGD_GOT_OFFER_REPLY, msg);
|
master_badmsg(WIRE_OPENINGD_GOT_OFFER_REPLY, msg);
|
||||||
|
|
||||||
/* If they give us a reason to reject, do so. */
|
/* If they give us a reason to reject, do so. */
|
||||||
@ -1030,6 +1032,11 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
|
|||||||
state->our_features,
|
state->our_features,
|
||||||
state->their_features);
|
state->their_features);
|
||||||
|
|
||||||
|
if (reserve != NULL) {
|
||||||
|
set_reserve_absolute(state, state->remoteconf.dust_limit,
|
||||||
|
*reserve);
|
||||||
|
}
|
||||||
|
|
||||||
/* OK, we accept! */
|
/* OK, we accept! */
|
||||||
accept_tlvs = tlv_accept_channel_tlvs_new(tmpctx);
|
accept_tlvs = tlv_accept_channel_tlvs_new(tmpctx);
|
||||||
accept_tlvs->upfront_shutdown_script
|
accept_tlvs->upfront_shutdown_script
|
||||||
|
@ -46,6 +46,7 @@ msgdata,openingd_got_offer_reply,rejection,?wirestring,
|
|||||||
msgdata,openingd_got_offer_reply,shutdown_len,u16,
|
msgdata,openingd_got_offer_reply,shutdown_len,u16,
|
||||||
msgdata,openingd_got_offer_reply,our_shutdown_scriptpubkey,?u8,shutdown_len
|
msgdata,openingd_got_offer_reply,our_shutdown_scriptpubkey,?u8,shutdown_len
|
||||||
msgdata,openingd_got_offer_reply,our_shutdown_wallet_index,?u32,
|
msgdata,openingd_got_offer_reply,our_shutdown_wallet_index,?u32,
|
||||||
|
msgdata,openingd_got_offer_reply,reserve,?amount_sat,
|
||||||
|
|
||||||
#include <common/penalty_base.h>
|
#include <common/penalty_base.h>
|
||||||
# Openingd->master: we've successfully offered channel.
|
# Openingd->master: we've successfully offered channel.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user