+func (w *Wallet) getGlobalTxByTxID(txID string) (*query.AnnotatedTx, error) {
+ globalTxIdx := w.DB.Get(calcGlobalTxIndexKey(txID))
+ if globalTxIdx == nil {
+ return nil, fmt.Errorf("No transaction(tx_id=%s) ", txID)
+ }
+
+ blockHash, pos := parseGlobalTxIdx(globalTxIdx)
+ block, err := w.chain.GetBlockByHash(blockHash)
+ if err != nil {
+ return nil, err
+ }
+
+ txStatus, err := w.chain.GetTransactionStatus(blockHash)
+ if err != nil {
+ return nil, err
+ }
+
+ statusFail, err := txStatus.GetStatus(int(pos))
+ if err != nil {
+ return nil, err
+ }
+
+ tx := block.Transactions[int(pos)]
+ return w.buildAnnotatedTransaction(tx, block, statusFail, int(pos)), nil
+}
+