mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Implement hidden "-pushversion" parameter for PoSe testing
This commit is contained in:
parent
32c83b432b
commit
d16b7dbcb5
@ -304,6 +304,8 @@ void UpdatePreferredDownload(CNode* node, CNodeState* state)
|
|||||||
|
|
||||||
void PushNodeVersion(CNode *pnode, CConnman* connman, int64_t nTime)
|
void PushNodeVersion(CNode *pnode, CConnman* connman, int64_t nTime)
|
||||||
{
|
{
|
||||||
|
const auto& params = Params();
|
||||||
|
|
||||||
ServiceFlags nLocalNodeServices = pnode->GetLocalServices();
|
ServiceFlags nLocalNodeServices = pnode->GetLocalServices();
|
||||||
uint64_t nonce = pnode->GetLocalNonce();
|
uint64_t nonce = pnode->GetLocalNonce();
|
||||||
int nNodeStartingHeight = pnode->GetMyStartingHeight();
|
int nNodeStartingHeight = pnode->GetMyStartingHeight();
|
||||||
@ -320,13 +322,18 @@ void PushNodeVersion(CNode *pnode, CConnman* connman, int64_t nTime)
|
|||||||
pnode->sentMNAuthChallenge = mnauthChallenge;
|
pnode->sentMNAuthChallenge = mnauthChallenge;
|
||||||
}
|
}
|
||||||
|
|
||||||
connman->PushMessage(pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, PROTOCOL_VERSION, (uint64_t)nLocalNodeServices, nTime, addrYou, addrMe,
|
int nProtocolVersion = PROTOCOL_VERSION;
|
||||||
|
if (params.NetworkIDString() != CBaseChainParams::MAIN && gArgs.IsArgSet("-pushversion")) {
|
||||||
|
nProtocolVersion = gArgs.GetArg("-pushversion", PROTOCOL_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
connman->PushMessage(pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, nProtocolVersion, (uint64_t)nLocalNodeServices, nTime, addrYou, addrMe,
|
||||||
nonce, strSubVersion, nNodeStartingHeight, ::fRelayTxes, mnauthChallenge, pnode->fMasternode));
|
nonce, strSubVersion, nNodeStartingHeight, ::fRelayTxes, mnauthChallenge, pnode->fMasternode));
|
||||||
|
|
||||||
if (fLogIPs) {
|
if (fLogIPs) {
|
||||||
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), addrYou.ToString(), nodeid);
|
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", nProtocolVersion, nNodeStartingHeight, addrMe.ToString(), addrYou.ToString(), nodeid);
|
||||||
} else {
|
} else {
|
||||||
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), nodeid);
|
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, peer=%d\n", nProtocolVersion, nNodeStartingHeight, addrMe.ToString(), nodeid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user