OSDN Git Service
(root)
/
bytom
/
bytom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1737a77
)
improve the way to reverse transactions
author
Yongfeng LI
<wliyongfeng@gmail.com>
Sat, 7 Apr 2018 11:00:35 +0000
(19:00 +0800)
committer
Yongfeng LI
<wliyongfeng@gmail.com>
Sat, 7 Apr 2018 11:00:35 +0000
(19:00 +0800)
wallet/indexer.go
patch
|
blob
|
history
diff --git
a/wallet/indexer.go
b/wallet/indexer.go
index
3f723ed
..
8bd8a9f
100755
(executable)
--- a/
wallet/indexer.go
+++ b/
wallet/indexer.go
@@
-443,12
+443,7
@@
func (w *Wallet) GetTransactionsByTxID(txID string) ([]*query.AnnotatedTx, error
if err := json.Unmarshal(txIter.Value(), annotatedTx); err != nil {
return nil, err
}
- annotatedTxs = append(annotatedTxs, annotatedTx)
- }
-
- // reverse annotatedTxs
- for i, j := 0, len(annotatedTxs) - 1; i < j; i, j = i + 1, j - 1 {
- annotatedTxs[i], annotatedTxs[j] = annotatedTxs[j], annotatedTxs[i]
+ annotatedTxs = append([]*query.AnnotatedTx{annotatedTx}, annotatedTxs...)
}
return annotatedTxs, nil