Skip to content

Commit

Permalink
wallet: fix linter/code smell issues
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Jan 15, 2024
1 parent 15bf9e1 commit 25a24d2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wallet/createtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package wallet

import (
"errors"
"fmt"
"math/rand"
"sort"
Expand Down Expand Up @@ -250,7 +251,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
}

Expand Down Expand Up @@ -279,7 +280,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
Expand Down Expand Up @@ -377,6 +378,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) {
Expand Down

0 comments on commit 25a24d2

Please sign in to comment.