Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | if (argsman.IsArgSet("-avaproof")) { | ||||
AVALANCHE_MAX_PROOF_STAKES); | AVALANCHE_MAX_PROOF_STAKES); | ||||
return nullptr; | return nullptr; | ||||
default: | default: | ||||
error = _("the avalanche proof is invalid"); | error = _("the avalanche proof is invalid"); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
} | } | ||||
// Generate the delegation to the session key. | |||||
DelegationBuilder dgb(peerData->proof); | DelegationBuilder dgb(peerData->proof); | ||||
if (argsman.IsArgSet("-avadelegation")) { | |||||
Delegation dg; | |||||
CDataStream stream(ParseHex(argsman.GetArg("-avadelegation", "")), | |||||
SER_NETWORK, 0); | |||||
stream >> dg; | |||||
deadalnix: What happens when this throws because the delegation is not hex or does not represent a… | |||||
if (!dgb.importDelegation(dg)) { | |||||
error = _("failed to import the supplied delegation"); | |||||
deadalnixUnsubmitted Not Done Inline ActionsThis is not a new problem here, but none of these errors match the existing style passed down to InitError . deadalnix: This is not a new problem here, but none of these errors match the existing style passed down… | |||||
deadalnixUnsubmitted Not Done Inline ActionsWhat does it mean that the delegation failed to import? Why? What do I need to do if the node spit that message back to me? I can't even tell from reading this part of the source code, how any users is supposed to be able to do anything with this? deadalnix: What does it mean that the delegation failed to import? Why? What do I need to do if the node… | |||||
return nullptr; | |||||
} | |||||
} | |||||
// Generate the delegation to the session key. | |||||
if (sessionKey.GetPubKey() != peerData->proof.getMaster()) { | if (sessionKey.GetPubKey() != peerData->proof.getMaster()) { | ||||
dgb.addLevel(masterKey, sessionKey.GetPubKey()); | dgb.addLevel(masterKey, sessionKey.GetPubKey()); | ||||
} | } | ||||
peerData->delegation = dgb.build(); | peerData->delegation = dgb.build(); | ||||
} | } | ||||
// We can't use std::make_unique with a private constructor | // We can't use std::make_unique with a private constructor | ||||
return std::unique_ptr<Processor>( | return std::unique_ptr<Processor>( | ||||
▲ Show 20 Lines • Show All 426 Lines • Show Last 20 Lines |
What happens when this throws because the delegation is not hex or does not represent a delegation at all?