mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
AlreadyHave(): only hold lock during mapTransactions access
This commit is contained in:
parent
dd21ce5f1b
commit
8bff8ac079
@ -2137,8 +2137,12 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv)
|
||||
{
|
||||
case MSG_TX:
|
||||
{
|
||||
LOCK(cs_mapTransactions);
|
||||
return mapTransactions.count(inv.hash) ||
|
||||
bool txInMap = false;
|
||||
{
|
||||
LOCK(cs_mapTransactions);
|
||||
txInMap = (mapTransactions.count(inv.hash) != 0);
|
||||
}
|
||||
return txInMap ||
|
||||
mapOrphanTransactions.count(inv.hash) ||
|
||||
txdb.ContainsTx(inv.hash);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user