mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-07 06:36:46 +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 (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
|
||||||
"github.com/daglabs/btcd/blockdag"
|
"github.com/daglabs/btcd/blockdag"
|
||||||
"github.com/daglabs/btcd/btcjson"
|
"github.com/daglabs/btcd/btcjson"
|
||||||
"github.com/daglabs/btcd/database"
|
"github.com/daglabs/btcd/database"
|
||||||
@ -112,10 +113,13 @@ func handleGetRawTransaction(s *Server, cmd interface{}, closeChan <-chan struct
|
|||||||
blkHashStr = blkHash.String()
|
blkHashStr = blkHash.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
confirmations, err := txConfirmations(s, tx.ID())
|
var confirmations uint64
|
||||||
|
if !isInMempool {
|
||||||
|
confirmations, err = txConfirmations(s, tx.ID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
rawTxn, err := createTxRawResult(s.cfg.DAGParams, tx.MsgTx(), txID.String(),
|
rawTxn, err := createTxRawResult(s.cfg.DAGParams, tx.MsgTx(), txID.String(),
|
||||||
blkHeader, blkHashStr, nil, &confirmations, isInMempool, txMass)
|
blkHeader, blkHashStr, nil, &confirmations, isInMempool, txMass)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user