Make it compile
This commit is contained in:
13
src/main.cpp
13
src/main.cpp
@@ -1538,8 +1538,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
||||
if (insecure_rand()%MAX_DOUBLESPEND_BLOOM == 0)
|
||||
doubleSpendFilter.clear();
|
||||
doubleSpendFilter.insert(relayForOutpoint);
|
||||
CFeeRate txFeeRate = CFeeRate(0);
|
||||
RelayTransaction(tx, txFeeRate);
|
||||
RelayTransaction(tx);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3633,10 +3632,13 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
|
||||
bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex * const pindexPrev)
|
||||
{
|
||||
const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1;
|
||||
|
||||
/*
|
||||
const Consensus::Params& consensusParams = Params().GetConsensus();
|
||||
|
||||
// Start enforcing BIP113 (Median Time Past) using versionbits logic.
|
||||
int nLockTimeFlags = 0;
|
||||
*/
|
||||
|
||||
int64_t nLockTimeCutoff = block.GetBlockTime();
|
||||
|
||||
@@ -4941,10 +4943,8 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
|
||||
}
|
||||
}
|
||||
|
||||
bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived)
|
||||
bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
|
||||
LogPrint("net", "received: %s (%u bytes) peer=%d\n", SanitizeString(strCommand), vRecv.size(), pfrom->id);
|
||||
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
|
||||
{
|
||||
@@ -4952,7 +4952,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (!(nLocalServices & NODE_BLOOM) &&
|
||||
(strCommand == NetMsgType::FILTERLOAD ||
|
||||
strCommand == NetMsgType::FILTERADD ||
|
||||
@@ -6205,7 +6204,7 @@ bool ProcessMessages(CNode* pfrom)
|
||||
bool fRet = false;
|
||||
try
|
||||
{
|
||||
fRet = ProcessMessage(pfrom, strCommand, vRecv, msg.nTime);
|
||||
fRet = ProcessMessage(pfrom, strCommand, vRecv, msg.nTime, chainparams);
|
||||
boost::this_thread::interruption_point();
|
||||
}
|
||||
catch (const std::ios_base::failure& e)
|
||||
|
||||
24
src/net.cpp
24
src/net.cpp
@@ -89,9 +89,6 @@ std::string strSubVersion;
|
||||
|
||||
vector<CNode*> vNodes;
|
||||
CCriticalSection cs_vNodes;
|
||||
map<CInv, CDataStream> mapRelay;
|
||||
deque<pair<int64_t, CInv> > vRelayExpiration;
|
||||
CCriticalSection cs_mapRelay;
|
||||
limitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ);
|
||||
|
||||
static deque<string> vOneShots;
|
||||
@@ -2045,29 +2042,8 @@ instance_of_cnetcleanup;
|
||||
|
||||
|
||||
void RelayTransaction(const CTransaction& tx)
|
||||
{
|
||||
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
|
||||
ss.reserve(10000);
|
||||
ss << tx;
|
||||
RelayTransaction(tx, feerate, ss);
|
||||
}
|
||||
|
||||
void RelayTransaction(const CTransaction& tx, CFeeRate feerate, const CDataStream& ss)
|
||||
{
|
||||
CInv inv(MSG_TX, tx.GetHash());
|
||||
{
|
||||
LOCK(cs_mapRelay);
|
||||
// Expire old relay messages
|
||||
while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime())
|
||||
{
|
||||
mapRelay.erase(vRelayExpiration.front().second);
|
||||
vRelayExpiration.pop_front();
|
||||
}
|
||||
|
||||
// Save original serialized message so newer versions are preserved
|
||||
mapRelay.insert(std::make_pair(inv, ss));
|
||||
vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv));
|
||||
}
|
||||
LOCK(cs_vNodes);
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
{
|
||||
|
||||
@@ -164,9 +164,6 @@ extern int nMaxConnections;
|
||||
|
||||
extern std::vector<CNode*> vNodes;
|
||||
extern CCriticalSection cs_vNodes;
|
||||
extern std::map<CInv, CDataStream> mapRelay;
|
||||
extern std::deque<std::pair<int64_t, CInv> > vRelayExpiration;
|
||||
extern CCriticalSection cs_mapRelay;
|
||||
extern limitedmap<uint256, int64_t> mapAlreadyAskedFor;
|
||||
|
||||
extern std::vector<std::string> vAddedNodes;
|
||||
@@ -782,7 +779,6 @@ public:
|
||||
|
||||
class CTransaction;
|
||||
void RelayTransaction(const CTransaction& tx);
|
||||
void RelayTransaction(const CTransaction& tx, const CDataStream& ss);
|
||||
|
||||
/** Access to the (IP) address database (peers.dat) */
|
||||
class CAddrDB
|
||||
|
||||
Reference in New Issue
Block a user