X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=wallet%2Findexer.go;h=f107aeceb04e9e34c09649e24e343d2c27999901;hb=refs%2Fheads%2Fupdate;hp=9f55115aeb27d6a976a6374e9a5f26b9672cc432;hpb=489e57ce3c46eb9e8ca25c7e966a1ea26fe41d57;p=bytom%2Fvapor.git diff --git a/wallet/indexer.go b/wallet/indexer.go index 9f55115a..f107aece 100644 --- a/wallet/indexer.go +++ b/wallet/indexer.go @@ -34,6 +34,9 @@ func saveExternalAssetDefinition(b *types.Block, store WalletStore) error { for _, tx := range b.Transactions { for _, orig := range tx.Inputs { if cci, ok := orig.TypedInput.(*types.CrossChainInput); ok { + if cci.AssetId.String() == consensus.BTMAssetID.String() { + continue + } assetID := cci.AssetId if _, err := newStore.GetAsset(assetID); err == nil { continue @@ -212,7 +215,7 @@ func (w *Wallet) GetTransactionsSummary(transactions []*query.AnnotatedTx) []TxS 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 @@ -238,16 +241,14 @@ func (w *Wallet) GetTransactions(accountID string, StartTxID string, count uint, 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