mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-06 06:06:49 +00:00
[NOD-1303] Fix concurent access to UTXO set from RPC (#892)
This commit is contained in:
parent
a6b8eea369
commit
83e7c9e8e4
@ -42,7 +42,7 @@ func (dag *BlockDAG) UTXOConfirmations(outpoint *appmessage.Outpoint) (uint64, b
|
||||
dag.dagLock.RLock()
|
||||
defer dag.dagLock.RUnlock()
|
||||
|
||||
utxoEntry, ok := dag.GetUTXOEntry(*outpoint)
|
||||
utxoEntry, ok := dag.virtual.utxoSet.get(*outpoint)
|
||||
if !ok {
|
||||
return 0, false
|
||||
}
|
||||
|
@ -248,6 +248,8 @@ func (dag *BlockDAG) CalcPastMedianTime() mstime.Time {
|
||||
// This function is safe for concurrent access. However, the returned entry (if
|
||||
// any) is NOT.
|
||||
func (dag *BlockDAG) GetUTXOEntry(outpoint appmessage.Outpoint) (*UTXOEntry, bool) {
|
||||
dag.RLock()
|
||||
defer dag.RUnlock()
|
||||
return dag.virtual.utxoSet.get(outpoint)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user