Add lock to mempool.GetTransaction (#1336)

This commit is contained in:
Ori Newman 2021-01-03 13:06:46 +02:00 committed by GitHub
parent 8c8da3b01f
commit 1abffd472c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,6 +114,8 @@ func New(consensus consensusexternalapi.Consensus, acceptNonStd bool) miningmana
func (mp *mempool) GetTransaction(
transactionID *consensusexternalapi.DomainTransactionID) (*consensusexternalapi.DomainTransaction, bool) {
mp.mtx.RLock()
defer mp.mtx.RUnlock()
txDesc, exists := mp.fetchTxDesc(transactionID)
if !exists {