OSDN Git Service

get-transaction by tx_id add annotateTxsAsset (#1029)
authoroysheng <33340252+oysheng@users.noreply.github.com>
Thu, 7 Jun 2018 09:26:55 +0000 (17:26 +0800)
committerPaladz <yzhu101@uottawa.ca>
Thu, 7 Jun 2018 09:26:55 +0000 (17:26 +0800)
* optmise list-transactions query by tx_id

* get-transaction by tx_id add annotateTxsAsset

wallet/indexer.go
wallet/unconfirmed.go

index bbef489..44f729a 100644 (file)
@@ -421,6 +421,7 @@ func (w *Wallet) GetTransactionByTxID(txID string) (*query.AnnotatedTx, error) {
        if err := json.Unmarshal(txInfo, annotatedTx); err != nil {
                return nil, err
        }
+       annotateTxsAsset(w, []*query.AnnotatedTx{annotatedTx})
 
        return annotatedTx, nil
 }
index ef214e4..04f0e3c 100644 (file)
@@ -58,6 +58,7 @@ func (w *Wallet) GetUnconfirmedTxByTxID(txID string) (*query.AnnotatedTx, error)
        if err := json.Unmarshal(txInfo, annotatedTx); err != nil {
                return nil, err
        }
+       annotateTxsAsset(w, []*query.AnnotatedTx{annotatedTx})
 
        return annotatedTx, nil
 }