Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | Processor::Processor(interfaces::Chain &chain, CConnman *connmanIn) | ||||
if (gArgs.IsArgSet("-avaproof")) { | if (gArgs.IsArgSet("-avaproof")) { | ||||
peerData = std::make_unique<PeerData>(); | peerData = std::make_unique<PeerData>(); | ||||
{ | { | ||||
// The proof. | // The proof. | ||||
CDataStream stream(ParseHex(gArgs.GetArg("-avaproof", "")), | CDataStream stream(ParseHex(gArgs.GetArg("-avaproof", "")), | ||||
SER_NETWORK, 0); | SER_NETWORK, 0); | ||||
stream >> peerData->proof; | stream >> peerData->proof; | ||||
// Ensure the peer manager knows about it. | |||||
LOCK(cs_peerManager); | LOCK(cs_peerManager); | ||||
peerManager->getPeer(peerData->proof); | peerManager->getPeerId(peerData->proof); | ||||
} | } | ||||
// Generate the delegation to the session key. | // Generate the delegation to the session key. | ||||
DelegationBuilder dgb(peerData->proof); | DelegationBuilder dgb(peerData->proof); | ||||
if (sessionKey.GetPubKey() != peerData->proof.getMaster()) { | if (sessionKey.GetPubKey() != peerData->proof.getMaster()) { | ||||
dgb.addLevel(DecodeSecret(gArgs.GetArg("-avamasterkey", "")), | dgb.addLevel(DecodeSecret(gArgs.GetArg("-avamasterkey", "")), | ||||
sessionKey.GetPubKey()); | sessionKey.GetPubKey()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 375 Lines • Show Last 20 Lines |