X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=wallet%2Findexer.go;fp=wallet%2Findexer.go;h=4bff9c942b7c6705bf2a76a0ab98f65e735728d0;hp=460177910b8872be8548a2f6d71a2b553a5cf0bf;hb=c18a765ea091998d61cb630250a9129f9f62f8ae;hpb=e2294cec495077e4d76d8ff22ad4cae63c4eb2d2 diff --git a/wallet/indexer.go b/wallet/indexer.go index 46017791..4bff9c94 100644 --- a/wallet/indexer.go +++ b/wallet/indexer.go @@ -310,7 +310,7 @@ func (w *Wallet) GetTransactions(accountID string, StartTxID string, count uint, preFix = UnconfirmedTxPrefix } - itr := w.DB.IteratorPrefixWithStart([]byte(preFix), startKey) + itr := w.DB.IteratorPrefixWithStart([]byte(preFix), startKey, true) defer itr.Release() for txNum := count; itr.Next() && txNum > 0; txNum-- { @@ -327,6 +327,8 @@ func (w *Wallet) GetTransactions(accountID string, StartTxID string, count uint, if unconfirmed { sort.Sort(SortByTimestamp(annotatedTxs)) + } else { + sort.Sort(SortByHeight(annotatedTxs)) } return annotatedTxs, nil