dual-fund: only allow for liquidity ads if both nodes support anchors
Otherwise we'd have to update the liquidity ads spec to get this shipped.
This commit is contained in:
parent
c9c367d770
commit
89f382cf39
|
@ -2070,15 +2070,6 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
|
||||||
else
|
else
|
||||||
state->upfront_shutdown_script[REMOTE] = NULL;
|
state->upfront_shutdown_script[REMOTE] = NULL;
|
||||||
|
|
||||||
/* This is an `option_will_fund` request */
|
|
||||||
if (open_tlv->request_funds) {
|
|
||||||
state->requested_lease = tal(state, struct amount_sat);
|
|
||||||
state->requested_lease->satoshis /* Raw: u64 -> sat conversion */
|
|
||||||
= open_tlv->request_funds->requested_sats;
|
|
||||||
tx_state->blockheight
|
|
||||||
= open_tlv->request_funds->blockheight;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* BOLT-* #2
|
/* BOLT-* #2
|
||||||
* If the peer's revocation basepoint is unknown (e.g.
|
* If the peer's revocation basepoint is unknown (e.g.
|
||||||
* `open_channel2`), a temporary `channel_id` should be found
|
* `open_channel2`), a temporary `channel_id` should be found
|
||||||
|
@ -2094,6 +2085,23 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
|
||||||
type_to_string(tmpctx, struct channel_id,
|
type_to_string(tmpctx, struct channel_id,
|
||||||
&cid));
|
&cid));
|
||||||
|
|
||||||
|
/* Since anchor outputs are optional, we
|
||||||
|
* only support liquidity ads if those are enabled. */
|
||||||
|
if (open_tlv->request_funds &&
|
||||||
|
!anchors_negotiated(state->our_features,
|
||||||
|
state->their_features))
|
||||||
|
negotiation_failed(state, "liquidity ads not supported,"
|
||||||
|
" no anchors.");
|
||||||
|
|
||||||
|
/* This is an `option_will_fund` request */
|
||||||
|
if (open_tlv->request_funds) {
|
||||||
|
state->requested_lease = tal(state, struct amount_sat);
|
||||||
|
state->requested_lease->satoshis /* Raw: u64 -> sat conversion */
|
||||||
|
= open_tlv->request_funds->requested_sats;
|
||||||
|
tx_state->blockheight
|
||||||
|
= open_tlv->request_funds->blockheight;
|
||||||
|
}
|
||||||
|
|
||||||
/* BOLT #2:
|
/* BOLT #2:
|
||||||
*
|
*
|
||||||
* The receiving node MUST fail the channel if:
|
* The receiving node MUST fail the channel if:
|
||||||
|
|
Loading…
Reference in New Issue