mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-04 13:16:43 +00:00
[NOD-392] If transaction is in mempool - don't try to get number of confirmations (#443)
This commit is contained in:
parent
f7fbfbf5c4
commit
47891b17ab
@ -3,6 +3,7 @@ package rpc
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
|
||||
"github.com/daglabs/btcd/blockdag"
|
||||
"github.com/daglabs/btcd/btcjson"
|
||||
"github.com/daglabs/btcd/database"
|
||||
@ -112,9 +113,12 @@ func handleGetRawTransaction(s *Server, cmd interface{}, closeChan <-chan struct
|
||||
blkHashStr = blkHash.String()
|
||||
}
|
||||
|
||||
confirmations, err := txConfirmations(s, tx.ID())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
var confirmations uint64
|
||||
if !isInMempool {
|
||||
confirmations, err = txConfirmations(s, tx.ID())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
rawTxn, err := createTxRawResult(s.cfg.DAGParams, tx.MsgTx(), txID.String(),
|
||||
blkHeader, blkHashStr, nil, &confirmations, isInMempool, txMass)
|
||||
|
Loading…
x
Reference in New Issue
Block a user