Skip to content

Commit

Permalink
[Cleanup] Fix cs_main in net_processing
Browse files Browse the repository at this point in the history
add extern declaration for now. cs_main will be removed from here.

(Also fix AcceptBlockHeader method signature).
  • Loading branch information
random-zebra committed Sep 28, 2020
1 parent f798b5f commit 34ad9d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct COrphanTx {
CTransaction tx;
NodeId fromPeer;
};

std::map<uint256, COrphanTx> mapOrphanTransactions GUARDED_BY(cs_main);
std::map<uint256, std::set<uint256> > mapOrphanTransactionsByPrev GUARDED_BY(cs_main);

Expand Down
2 changes: 2 additions & 0 deletions src/net_processing.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "net.h"
#include "validationinterface.h"

extern RecursiveMutex cs_main; // !TODO: change mutex to cs_orphans

/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
/** Default for -blockspamfilter, use header spam filter */
Expand Down
2 changes: 1 addition & 1 deletion src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ bool TestBlockValidity(CValidationState& state, const CBlock& block, CBlockIndex

/** Store block on disk. If dbp is provided, the file is known to already reside on disk */
bool AcceptBlock(const CBlock& block, CValidationState& state, CBlockIndex** pindex, CDiskBlockPos* dbp = NULL, bool fAlreadyCheckedBlock = false);
bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex = NULL);
bool AcceptBlockHeader(const CBlock& block, CValidationState& state, CBlockIndex** ppindex = NULL);


/** RAII wrapper for VerifyDB: Verify consistency of the block and coin databases */
Expand Down

0 comments on commit 34ad9d5

Please sign in to comment.