Changeset View
Changeset View
Standalone View
Standalone View
src/protocol.cpp
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | bool CMessageHeader::IsOversized(const Config &config) const { | ||||
// Scale the maximum accepted size with the block size. | // Scale the maximum accepted size with the block size. | ||||
if (nMessageSize > 2 * config.GetMaxBlockSize()) { | if (nMessageSize > 2 * config.GetMaxBlockSize()) { | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
CAddress::CAddress() : CService() { | |||||
Init(); | |||||
} | |||||
CAddress::CAddress(CService ipIn, ServiceFlags nServicesIn) : CService(ipIn) { | |||||
Init(); | |||||
nServices = nServicesIn; | |||||
} | |||||
void CAddress::Init() { | |||||
nServices = NODE_NONE; | |||||
nTime = 100000000; | |||||
} | |||||
std::string CInv::GetCommand() const { | std::string CInv::GetCommand() const { | ||||
std::string cmd; | std::string cmd; | ||||
switch (GetKind()) { | switch (GetKind()) { | ||||
case MSG_TX: | case MSG_TX: | ||||
return cmd.append(NetMsgType::TX); | return cmd.append(NetMsgType::TX); | ||||
case MSG_BLOCK: | case MSG_BLOCK: | ||||
return cmd.append(NetMsgType::BLOCK); | return cmd.append(NetMsgType::BLOCK); | ||||
case MSG_FILTERED_BLOCK: | case MSG_FILTERED_BLOCK: | ||||
Show All 20 Lines |