From 4185a86d90429d406f1adc3620f61683fe6c19e3 Mon Sep 17 00:00:00 2001 From: niftynei Date: Tue, 17 Nov 2020 19:49:10 -0600 Subject: [PATCH] df-mfc: set the minimum input weight to 110 iif v2 We only need a bumped up input weight if we're talking to nodes that require v2. --- plugins/spender/multifundchannel.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/spender/multifundchannel.c b/plugins/spender/multifundchannel.c index 9fe215fd7..c185ca202 100644 --- a/plugins/spender/multifundchannel.c +++ b/plugins/spender/multifundchannel.c @@ -723,6 +723,16 @@ perform_fundpsbt(struct multifundchannel_command *mfc) tal_fmt(tmpctx, "%zu", startweight)); } + /* If we've got v2 opens, we need to use a min weight of 110. */ + /* BOLT-78de9a79b491ae9fb84b1fdb4546bacf642dce87 #2 + * The minimum witness weight for an input is 110. + */ + if (dest_count(mfc, OPEN_CHANNEL) > 0) { + json_add_string(req->js, "min_witness_weight", + tal_fmt(tmpctx, "%u", 110)); + } + + return send_outreq(mfc->cmd->plugin, req); }