dual-fund: patch in channel_type logic

There's no reason not to use the channel-types (same as v1s) for v2
opens.

Brings us into compliance with ACINQ's implementation afaict
This commit is contained in:
niftynei
2022-10-21 16:16:45 -05:00
committed by Rusty Russell
parent 4fe8e1eccf
commit df4bd6287a
5 changed files with 91 additions and 37 deletions

View File

@@ -61,6 +61,10 @@ struct channel_type *default_channel_type(const tal_t *ctx,
if (feature_negotiated(our_features, their_features,
OPT_ANCHOR_OUTPUTS))
return channel_type_anchor_outputs(ctx);
else if (feature_negotiated(our_features, their_features,
OPT_DUAL_FUND))
/* OPT_DUAL_FUND implies static remotekey */
return channel_type_static_remotekey(ctx);
/* BOLT #2:
* - otherwise, if `option_static_remotekey` was negotiated:
* - the `channel_type` is `option_static_remotekey` (bit 12)