Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual-funding over multifundchannel fixups, etc #4211

Merged
merged 6 commits into from
Dec 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
df-mfc: set protocol type when we know it
We'll use it for figuring out whether or not to set a utxo witness
minimum, which comes much before we were setting this field.

Now we set the protocol as soon as we can reasonably deduce it.
  • Loading branch information
niftynei committed Nov 24, 2020
commit 779589c6ddc5023f0024b657fb0a600b578c21ff
17 changes: 10 additions & 7 deletions plugins/spender/multifundchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,14 @@ connect_ok(struct command *cmd,
json_tok_full_len(features_tok),
json_tok_full(buf, features_tok));

/* Set the open protocol to use now */
#if EXPERIMENTAL_FEATURES
if (feature_negotiated(plugin_feature_set(mfc->cmd->plugin),
dest->their_features,
OPT_DUAL_FUND))
dest->protocol = OPEN_CHANNEL;
#endif /* EXPERIMENTAL_FEATURES */

dest->state = MULTIFUNDCHANNEL_CONNECTED;
return connect_done(dest);
}
Expand Down Expand Up @@ -961,14 +969,9 @@ perform_channel_start(struct multifundchannel_command *mfc)
/* Since v2 is now available, we branch depending
* on the capability of the peer and our feaures */
for (i = 0; i < tal_count(mfc->destinations); ++i) {
#if EXPERIMENTAL_FEATURES
if (feature_negotiated(plugin_feature_set(mfc->cmd->plugin),
mfc->destinations[i].their_features,
OPT_DUAL_FUND)) {
mfc->destinations[i].protocol = OPEN_CHANNEL;
if (mfc->destinations[i].protocol == OPEN_CHANNEL)
openchannel_init_dest(&mfc->destinations[i]);
} else
#endif /* EXPERIMENTAL_FEATURES */
else
fundchannel_start_dest(&mfc->destinations[i]);
}

Expand Down