Skip to content

Commit

Permalink
wallet: return ErrNotMine for script addresses
Browse files Browse the repository at this point in the history
We recently added the ManagedTaprootScriptAddress type which is not a
ManagedPubKeyAddress and therefore doesn't store the derivation info.
When trying to fetch the input info for such an address we run into the
case where we return nil as the error which causes issues further up in
the call stack.
This commit fixes the problem by returning an actual error and not the
err variable that is nil due to the previous check.
  • Loading branch information
guggero committed Feb 6, 2024
1 parent d356b54 commit 9f5bc13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wallet/utxos.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (w *Wallet) FetchInputInfo(prevOut *wire.OutPoint) (*wire.MsgTx,
}
pubKeyAddr, ok := addr.(waddrmgr.ManagedPubKeyAddress)
if !ok {
return nil, nil, nil, 0, err
return nil, nil, nil, 0, ErrNotMine
}
keyScope, derivationPath, _ := pubKeyAddr.DerivationInfo()

Expand Down

0 comments on commit 9f5bc13

Please sign in to comment.