Skip to content

Commit 133cf7b

Browse files
committed
btc: fix incorrect index being used
1 parent e5c1307 commit 133cf7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

btc/explorer_api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ func (a *ExplorerAPI) Unspent(addr string) ([]*Vout, error) {
168168
// Now filter those that are really unspent, because above we get all
169169
// outputs that are sent to the address.
170170
var unspent []*Vout
171-
for idx, vout := range outputs {
171+
for _, vout := range outputs {
172172
url := fmt.Sprintf(
173173
"%s/tx/%s/outspend/%d", a.BaseURL, vout.Outspend.Txid,
174-
idx,
174+
vout.Outspend.Vin,
175175
)
176176
outspend := Outspend{}
177177
err := fetchJSON(url, &outspend)

0 commit comments

Comments
 (0)