AlreadyHave(): only hold lock during mapTransactions access
This commit is contained in:
parent
dd21ce5f1b
commit
8bff8ac079
@ -2136,9 +2136,13 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv)
|
|||||||
switch (inv.type)
|
switch (inv.type)
|
||||||
{
|
{
|
||||||
case MSG_TX:
|
case MSG_TX:
|
||||||
|
{
|
||||||
|
bool txInMap = false;
|
||||||
{
|
{
|
||||||
LOCK(cs_mapTransactions);
|
LOCK(cs_mapTransactions);
|
||||||
return mapTransactions.count(inv.hash) ||
|
txInMap = (mapTransactions.count(inv.hash) != 0);
|
||||||
|
}
|
||||||
|
return txInMap ||
|
||||||
mapOrphanTransactions.count(inv.hash) ||
|
mapOrphanTransactions.count(inv.hash) ||
|
||||||
txdb.ContainsTx(inv.hash);
|
txdb.ContainsTx(inv.hash);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user