diff --git a/wallet/createtx.go b/wallet/createtx.go index 511b3c42d6..b69426e4a6 100644 --- a/wallet/createtx.go +++ b/wallet/createtx.go @@ -6,6 +6,7 @@ package wallet import ( + "errors" "fmt" "math/rand" "sort" @@ -244,7 +245,7 @@ func (w *Wallet) txToOutputs(outputs []*wire.TxOut, return nil }) - if err != nil && err != walletdb.ErrDryRunRollBack { + if err != nil && !errors.Is(err, walletdb.ErrDryRunRollBack) { return nil, err } @@ -273,7 +274,7 @@ func (w *Wallet) findEligibleOutputs(dbtx walletdb.ReadTx, output := &unspent[i] // Only include this output if it meets the required number of - // confirmations. Coinbase transactions must have have reached + // confirmations. Coinbase transactions must have reached // maturity before their outputs may be spent. if !confirmed(minconf, output.Height, bs.Height) { continue @@ -371,6 +372,9 @@ func (w *Wallet) addrMgrWithChangeSource(dbtx walletdb.ReadWriteTx, scriptSize = txsizes.P2WPKHPkScriptSize case waddrmgr.TaprootPubKey: scriptSize = txsizes.P2TRPkScriptSize + default: + return nil, nil, fmt.Errorf("unsupported address type: %v", + addrType) } newChangeScript := func() ([]byte, error) {