From 133cf7b19155fac83849fd3f0be4503f0a8d98a1 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 12 Jul 2024 09:32:13 +0200 Subject: [PATCH] btc: fix incorrect index being used --- btc/explorer_api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/btc/explorer_api.go b/btc/explorer_api.go index a22e942..f6c0e8b 100644 --- a/btc/explorer_api.go +++ b/btc/explorer_api.go @@ -168,10 +168,10 @@ func (a *ExplorerAPI) Unspent(addr string) ([]*Vout, error) { // Now filter those that are really unspent, because above we get all // outputs that are sent to the address. var unspent []*Vout - for idx, vout := range outputs { + for _, vout := range outputs { url := fmt.Sprintf( "%s/tx/%s/outspend/%d", a.BaseURL, vout.Outspend.Txid, - idx, + vout.Outspend.Vin, ) outspend := Outspend{} err := fetchJSON(url, &outspend)