mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 01:07:57 +00:00
Announce --testnet in Hello.
This commit is contained in:
@@ -627,7 +627,14 @@ void Peer::recvHello(ripple::TMHello& packet)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (packet.has_nettime() && ((packet.nettime() < minTime) || (packet.nettime() > maxTime)))
|
||||
if ((packet.has_testnet() && packet.testnet()) != theConfig.TESTNET)
|
||||
{
|
||||
// Format: actual/requested.
|
||||
cLog(lsINFO) << boost::str(boost::format("Recv(Hello): Network mismatch: %d/%d")
|
||||
% packet.testnet()
|
||||
% theConfig.TESTNET);
|
||||
}
|
||||
else if (packet.has_nettime() && ((packet.nettime() < minTime) || (packet.nettime() > maxTime)))
|
||||
{
|
||||
if (packet.nettime() > maxTime)
|
||||
{
|
||||
@@ -1619,6 +1626,7 @@ void Peer::sendHello()
|
||||
h.set_nodeproof(&vchSig[0], vchSig.size());
|
||||
h.set_ipv4port(theConfig.PEER_PORT);
|
||||
h.set_nodeprivate(theConfig.PEER_PRIVATE);
|
||||
h.set_testnet(theConfig.TESTNET);
|
||||
|
||||
Ledger::pointer closedLedger = theApp->getLedgerMaster().getClosedLedger();
|
||||
if (closedLedger && closedLedger->isClosed())
|
||||
|
||||
@@ -71,6 +71,7 @@ message TMHello {
|
||||
optional bytes ledgerPrevious = 10; // the ledger before the last closed ledger
|
||||
optional bool nodePrivate = 11; // Request to not forward IP.
|
||||
optional TMProofWork proofOfWork = 12; // request/provide proof of work
|
||||
optional bool testNet = 13; // Running as testnet.
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user