confirmedUTXOs = append(confirmedUTXOs, utxo)
}
+
return confirmedUTXOs, nil
}
return nil, err
}
- annotatedTxs = append(annotatedTxs, annotatedTx)
- txNum--
+ if accountID == "" || wallet.FindTransactionsByAccount(annotatedTx, accountID) {
+ annotatedTxs = append([]*query.AnnotatedTx{annotatedTx}, annotatedTxs...)
+ txNum--
+ }
+
}
return annotatedTxs, nil
return Txs
}
-func findTransactionsByAccount(annotatedTx *query.AnnotatedTx, accountID string) bool {
+func FindTransactionsByAccount(annotatedTx *query.AnnotatedTx, accountID string) bool {
for _, input := range annotatedTx.Inputs {
if input.AccountID == accountID {
return true
newAnnotatedTxs := []*query.AnnotatedTx{}
for _, annotatedTx := range annotatedTxs {
- if accountID == "" || findTransactionsByAccount(annotatedTx, accountID) {
- annotateTxsAsset(w, []*query.AnnotatedTx{annotatedTx})
- newAnnotatedTxs = append([]*query.AnnotatedTx{annotatedTx}, newAnnotatedTxs...)
- }
+ annotateTxsAsset(w, []*query.AnnotatedTx{annotatedTx})
+ newAnnotatedTxs = append([]*query.AnnotatedTx{annotatedTx}, newAnnotatedTxs...)
}
if unconfirmed {
- sort.Sort(SortByTimestamp(annotatedTxs))
+ sort.Sort(SortByTimestamp(newAnnotatedTxs))
} else {
- sort.Sort(SortByHeight(annotatedTxs))
+ sort.Sort(SortByHeight(newAnnotatedTxs))
}
return newAnnotatedTxs, nil
newAnnotatedTxs := []*query.AnnotatedTx{}
for _, annotatedTx := range annotatedTxs {
- if accountID == "" || findTransactionsByAccount(annotatedTx, accountID) {
+ if accountID == "" || FindTransactionsByAccount(annotatedTx, accountID) {
annotateTxsAsset(w, []*query.AnnotatedTx{annotatedTx})
newAnnotatedTxs = append([]*query.AnnotatedTx{annotatedTx}, newAnnotatedTxs...)
}