Return utxos by sorted by desceding block height

This commit is contained in:
Martin Boehm 2019-03-20 17:32:10 +01:00
parent 846b20c795
commit 1d8389bb2c

View File

@ -856,7 +856,7 @@ func (w *Worker) getAddrDescUtxo(addrDesc bchain.AddressDescriptor, ba *db.AddrB
return nil, err
}
bestheight := int(b)
for i := len(outpoints) - 1; i >= 0 && checksum.Int64() > 0; i-- {
for i := 0; i < len(outpoints) && checksum.Int64() > 0; i++ {
o := outpoints[i]
if lastTxid != o.Txid {
ta, err = w.db.GetTxAddresses(o.Txid)