From 9f5bc13624810d993395370d858e803c5a260a00 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 6 Feb 2024 13:35:05 +0100 Subject: [PATCH] wallet: return ErrNotMine for script addresses 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. --- wallet/utxos.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallet/utxos.go b/wallet/utxos.go index 0d2e8ab536..63c6b5b770 100644 --- a/wallet/utxos.go +++ b/wallet/utxos.go @@ -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()