X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fmain.cpp;h=57c18aed48405d7bae6887028f273638c13728f0;hb=12570da46ff9de4201ae9f3411db0e955d2993de;hp=059dd3db9e0968a725507eb1e99dace13222a913;hpb=8460185dec74383b1e49500683cfc7aa9ceba554;p=novacoin.git diff --git a/src/main.cpp b/src/main.cpp index 059dd3d..57c18ae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1953,7 +1953,14 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv) { switch (inv.type) { - case MSG_TX: return mapTransactions.count(inv.hash) || mapOrphanTransactions.count(inv.hash) || txdb.ContainsTx(inv.hash); + case MSG_TX: + CRITICAL_BLOCK(cs_mapTransactions) + { + return mapTransactions.count(inv.hash) || + mapOrphanTransactions.count(inv.hash) || + txdb.ContainsTx(inv.hash); + } + case MSG_BLOCK: return mapBlockIndex.count(inv.hash) || mapOrphanBlocks.count(inv.hash); } // Don't know what it is, just say we already got one