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 17, 2024
1 parent c785ad3 commit 9cc6ca4
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 @@ -255,7 +256,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 @@ -284,7 +285,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 @@ -382,6 +383,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 9cc6ca4

Please sign in to comment.