mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-05 14:14:23 +01:00
dual-fund: Fail if you try to buy a liquidity ad w/o dualfunding on
Fixes #5271 In-Collaboration-With: Base58 'n Coding Seminar Participants Changelog-Changed: `fundchannel` now errors if you try to buy a liquidity ad but dont' have `experimental-dual-fund` enabled
This commit is contained in:
@@ -1611,13 +1611,21 @@ connect_ok(struct command *cmd,
|
||||
json_tok_full_len(features_tok),
|
||||
json_tok_full(buf, features_tok));
|
||||
|
||||
dest->state = MULTIFUNDCHANNEL_CONNECTED;
|
||||
|
||||
/* Set the open protocol to use now */
|
||||
if (feature_negotiated(plugin_feature_set(mfc->cmd->plugin),
|
||||
dest->their_features,
|
||||
OPT_DUAL_FUND))
|
||||
dest->protocol = OPEN_CHANNEL;
|
||||
else if (!amount_sat_zero(dest->request_amt) || !(!dest->rates))
|
||||
/* Return an error */
|
||||
fail_destination_msg(dest, FUNDING_V2_NOT_SUPPORTED,
|
||||
"Tried to buy a liquidity ad"
|
||||
" but we(?) don't have"
|
||||
" experimental-dual-fund"
|
||||
" enabled");
|
||||
|
||||
dest->state = MULTIFUNDCHANNEL_CONNECTED;
|
||||
return connect_done(dest);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user