Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 2,435 Lines • ▼ Show 20 Lines | g_avalanche = std::make_unique<avalanche::Processor>( | ||||
*node.chain, node.connman.get(), node.peerman.get()); | *node.chain, node.connman.get(), node.peerman.get()); | ||||
if (args.GetBoolArg("-enableavalanche", AVALANCHE_DEFAULT_ENABLED)) { | if (args.GetBoolArg("-enableavalanche", AVALANCHE_DEFAULT_ENABLED)) { | ||||
nLocalServices = ServiceFlags(nLocalServices | NODE_AVALANCHE); | nLocalServices = ServiceFlags(nLocalServices | NODE_AVALANCHE); | ||||
// If avalanche is enabled and a proof is supplied, make sure it does | // If avalanche is enabled and a proof is supplied, make sure it does | ||||
// not contain garbage. At this point the validity of the utxos cannot | // not contain garbage. At this point the validity of the utxos cannot | ||||
// be checked, so only basic verification is performed. | // be checked, so only basic verification is performed. | ||||
try { | try { | ||||
avalanche::Proof proof; | const avalanche::Proof proof = g_avalanche->getLocalProof(); | ||||
proof = g_avalanche->getProof(); | |||||
avalanche::ProofValidationState proof_state; | avalanche::ProofValidationState proof_state; | ||||
if (!proof.verify(proof_state)) { | if (!proof.verify(proof_state)) { | ||||
switch (proof_state.GetResult()) { | switch (proof_state.GetResult()) { | ||||
case avalanche::ProofValidationResult::NO_STAKE: | case avalanche::ProofValidationResult::NO_STAKE: | ||||
InitError(_("the avalanche proof has no stake")); | InitError(_("the avalanche proof has no stake")); | ||||
return false; | return false; | ||||
case avalanche::ProofValidationResult::DUST_THRESOLD: | case avalanche::ProofValidationResult::DUST_THRESOLD: | ||||
▲ Show 20 Lines • Show All 552 Lines • Show Last 20 Lines |