Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 3,071 Lines • ▼ Show 20 Lines | if (state.fShouldBan) { | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
bool ProcessMessages(const Config &config, CNode *pfrom, CConnman &connman, | bool ProcessMessages(const Config &config, CNode *pfrom, CConnman &connman, | ||||
const std::atomic<bool> &interruptMsgProc) { | const std::atomic<bool> &interruptMsgProc) { | ||||
const CChainParams &chainparams = Params(); | const CChainParams &chainparams = config.GetChainParams(); | ||||
// | // | ||||
// Message format | // Message format | ||||
// (4) message start | // (4) message start | ||||
// (12) command | // (12) command | ||||
// (4) size | // (4) size | ||||
// (4) checksum | // (4) checksum | ||||
// (x) data | // (x) data | ||||
// | // | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | bool operator()(std::set<uint256>::iterator a, | ||||
/* As std::make_heap produces a max-heap, we want the entries with the | /* As std::make_heap produces a max-heap, we want the entries with the | ||||
* fewest ancestors/highest fee to sort later. */ | * fewest ancestors/highest fee to sort later. */ | ||||
return mp->CompareDepthAndScore(*b, *a); | return mp->CompareDepthAndScore(*b, *a); | ||||
} | } | ||||
}; | }; | ||||
bool SendMessages(const Config &config, CNode *pto, CConnman &connman, | bool SendMessages(const Config &config, CNode *pto, CConnman &connman, | ||||
const std::atomic<bool> &interruptMsgProc) { | const std::atomic<bool> &interruptMsgProc) { | ||||
const Consensus::Params &consensusParams = Params().GetConsensus(); | const Consensus::Params &consensusParams = | ||||
config.GetChainParams().GetConsensus(); | |||||
// Don't send anything until the version handshake is complete | // Don't send anything until the version handshake is complete | ||||
if (!pto->fSuccessfullyConnected || pto->fDisconnect) { | if (!pto->fSuccessfullyConnected || pto->fDisconnect) { | ||||
return true; | return true; | ||||
} | } | ||||
// If we get here, the outgoing message serialization version is set and | // If we get here, the outgoing message serialization version is set and | ||||
// can't change. | // can't change. | ||||
▲ Show 20 Lines • Show All 598 Lines • Show Last 20 Lines |