From 9b1b92bf9837ce05008fdf20626081fcc5fdde4f Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Mon, 28 Jun 2021 11:20:33 +0200 Subject: [PATCH] lncli: fix psbt fund parameter parsing The sat_per_vbyte parameter was ignored because of a default value for conf_target. --- cmd/lncli/walletrpc_active.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/lncli/walletrpc_active.go b/cmd/lncli/walletrpc_active.go index 21870d46..3d8f8912 100644 --- a/cmd/lncli/walletrpc_active.go +++ b/cmd/lncli/walletrpc_active.go @@ -651,15 +651,16 @@ func fundPsbt(ctx *cli.Context) error { return fmt.Errorf("cannot set conf_target and sat_per_vbyte " + "at the same time") - case ctx.Uint64("conf_target") > 0: - req.Fees = &walletrpc.FundPsbtRequest_TargetConf{ - TargetConf: uint32(ctx.Uint64("conf_target")), - } - case ctx.Uint64("sat_per_vbyte") > 0: req.Fees = &walletrpc.FundPsbtRequest_SatPerVbyte{ SatPerVbyte: ctx.Uint64("sat_per_vbyte"), } + + // Check conf_target last because it has a default value. + case ctx.Uint64("conf_target") > 0: + req.Fees = &walletrpc.FundPsbtRequest_TargetConf{ + TargetConf: uint32(ctx.Uint64("conf_target")), + } } walletClient, cleanUp := getWalletClient(ctx)