Merge pull request #766 from LN-Zap/fix/fundpsbt-minconfs

wallet: add minimum confirmation parameter to FundPsbt
This commit is contained in:
Olaoluwa Osuntokun 2021-10-07 16:59:40 -07:00 committed by GitHub
commit 5f2c12c1cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -41,7 +41,7 @@ import (
// selected/validated inputs by this method. It is in the caller's
// responsibility to lock the inputs before handing the partial transaction out.
func (w *Wallet) FundPsbt(packet *psbt.Packet, keyScope *waddrmgr.KeyScope,
account uint32, feeSatPerKB btcutil.Amount,
minConfs int32, account uint32, feeSatPerKB btcutil.Amount,
coinSelectionStrategy CoinSelectionStrategy) (int32, error) {
// Make sure the packet is well formed. We only require there to be at
@ -138,7 +138,7 @@ func (w *Wallet) FundPsbt(packet *psbt.Packet, keyScope *waddrmgr.KeyScope,
// includes everything we need, specifically fee estimation and
// change address creation.
tx, err = w.CreateSimpleTx(
keyScope, account, packet.UnsignedTx.TxOut, 1,
keyScope, account, packet.UnsignedTx.TxOut, minConfs,
feeSatPerKB, coinSelectionStrategy, false,
)
if err != nil {

View file

@ -234,7 +234,7 @@ func TestFundPsbt(t *testing.T) {
tc := tc
t.Run(tc.name, func(t *testing.T) {
changeIndex, err := w.FundPsbt(
tc.packet, nil, 0, tc.feeRateSatPerKB,
tc.packet, nil, 1, 0, tc.feeRateSatPerKB,
CoinSelectionLargest,
)