Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | if (argsman.IsArgSet("-avaproof")) { | ||||
} | } | ||||
masterKey = DecodeSecret(argsman.GetArg("-avamasterkey", "")); | masterKey = DecodeSecret(argsman.GetArg("-avamasterkey", "")); | ||||
if (!masterKey.IsValid()) { | if (!masterKey.IsValid()) { | ||||
error = _("The avalanche master key is invalid."); | error = _("The avalanche master key is invalid."); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
peerData = std::make_unique<PeerData>(); | auto proof = RCUPtr<Proof>::make(); | ||||
Proof proof; | if (!Proof::FromHex(*proof, argsman.GetArg("-avaproof", ""), error)) { | ||||
if (!Proof::FromHex(proof, argsman.GetArg("-avaproof", ""), error)) { | |||||
// error is set by FromHex | // error is set by FromHex | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
peerData->proof = std::make_shared<Proof>(std::move(proof)); | |||||
peerData = std::make_unique<PeerData>(); | |||||
peerData->proof = std::move(proof); | |||||
if (!VerifyProof(*peerData->proof, error)) { | if (!VerifyProof(*peerData->proof, error)) { | ||||
// error is set by VerifyProof | // error is set by VerifyProof | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
std::unique_ptr<DelegationBuilder> dgb; | std::unique_ptr<DelegationBuilder> dgb; | ||||
const CPubKey &masterPubKey = masterKey.GetPubKey(); | const CPubKey &masterPubKey = masterKey.GetPubKey(); | ||||
▲ Show 20 Lines • Show All 634 Lines • Show Last 20 Lines |