Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions itest/lnd_psbt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,8 @@ func fundPsbtCoinSelect(t testing.TB, node *node.HarnessNode,
Template: &walletrpc.FundPsbtRequest_CoinSelect{
CoinSelect: cs,
},
Fees: &walletrpc.FundPsbtRequest_SatPerVbyte{
SatPerVbyte: 50,
Fees: &walletrpc.FundPsbtRequest_TargetConf{
TargetConf: 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Commit msg says testing this scenario, tho I don't think it's tested here - the branch below was not executed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the change in lnrpc/walletrpc/walletkit_server.go and ran make itest icase='fund_psbt'. It failed:

=== RUN   TestLightningNetworkDaemon/tranche00/67-of-309/btcd/fund_psbt
    harness_node.go:395: Starting node (name=Alice) with PID=971348
    harness_node.go:395: Starting node (name=Bob) with PID=971361
    harness_rpc.go:100: 
                Error Trace:    /home/user/lnd/lntest/rpc/harness_rpc.go:100
                                                        /home/user/lnd/lntest/rpc/wallet_kit.go:66
                                                        /home/user/lnd/itest/lnd_psbt_test.go:1252
                                                        /home/user/lnd/itest/lnd_psbt_test.go:1140
                                                        /home/user/lnd/lntest/harness.go:315
                                                        /home/user/lnd/itest/lnd_test.go:130
                Error:          Received unexpected error:
                                rpc error: code = Unknown desc = confirmation target must be greater than 1
                Messages:       Alice: failed to call FundPsbt
    harness.go:393: finished test: fund_psbt, start height=438, end height=440, mined blocks=2
    harness.go:352: test failed, skipped cleanup

},
})

Expand Down
4 changes: 2 additions & 2 deletions lnrpc/walletrpc/walletkit_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1555,9 +1555,9 @@ func (w *WalletKit) FundPsbt(_ context.Context,
// Estimate the fee by the target number of blocks to confirmation.
case req.GetTargetConf() != 0:
targetConf := req.GetTargetConf()
if targetConf < 2 {
if targetConf < 1 {
return nil, fmt.Errorf("confirmation target must be " +
"greater than 1")
"greater than 0")
}

feeSatPerKW, err = w.cfg.FeeEstimator.EstimateFeePerKW(
Expand Down