File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ struct COrphanTx {
70
70
NodeId fromPeer;
71
71
int64_t nTimeExpire;
72
72
};
73
- static CCriticalSection g_cs_orphans;
73
+ CCriticalSection g_cs_orphans;
74
74
std::map<uint256, COrphanTx> mapOrphanTransactions GUARDED_BY (g_cs_orphans);
75
75
76
76
void EraseOrphansFor (NodeId peer);
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ struct COrphanTx {
31
31
NodeId fromPeer;
32
32
int64_t nTimeExpire;
33
33
};
34
- extern std::map<uint256, COrphanTx> mapOrphanTransactions;
34
+ extern CCriticalSection g_cs_orphans;
35
+ extern std::map<uint256, COrphanTx> mapOrphanTransactions GUARDED_BY (g_cs_orphans);
35
36
36
37
static CService ip (uint32_t i)
37
38
{
@@ -324,7 +325,7 @@ BOOST_AUTO_TEST_CASE(DoS_bantime)
324
325
static CTransactionRef RandomOrphan ()
325
326
{
326
327
std::map<uint256, COrphanTx>::iterator it;
327
- LOCK (cs_main);
328
+ LOCK2 (cs_main, g_cs_orphans );
328
329
it = mapOrphanTransactions.lower_bound (InsecureRand256 ());
329
330
if (it == mapOrphanTransactions.end ())
330
331
it = mapOrphanTransactions.begin ();
@@ -394,7 +395,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
394
395
BOOST_CHECK (!AddOrphanTx (MakeTransactionRef (tx), i));
395
396
}
396
397
397
- LOCK (cs_main);
398
+ LOCK2 (cs_main, g_cs_orphans );
398
399
// Test EraseOrphansFor:
399
400
for (NodeId i = 0 ; i < 3 ; i++)
400
401
{
You can’t perform that action at this time.
0 commit comments