Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show All 37 Lines | |||||
static bool VerifyProof(const Proof &proof, bilingual_str &error) { | static bool VerifyProof(const Proof &proof, bilingual_str &error) { | ||||
ProofValidationState proof_state; | ProofValidationState proof_state; | ||||
if (!proof.verify(proof_state)) { | if (!proof.verify(proof_state)) { | ||||
switch (proof_state.GetResult()) { | switch (proof_state.GetResult()) { | ||||
case ProofValidationResult::NO_STAKE: | case ProofValidationResult::NO_STAKE: | ||||
error = _("The avalanche proof has no stake."); | error = _("The avalanche proof has no stake."); | ||||
return false; | return false; | ||||
case ProofValidationResult::DUST_THRESOLD: | case ProofValidationResult::DUST_THRESHOLD: | ||||
error = _("The avalanche proof stake is too low."); | error = _("The avalanche proof stake is too low."); | ||||
return false; | return false; | ||||
case ProofValidationResult::DUPLICATE_STAKE: | case ProofValidationResult::DUPLICATE_STAKE: | ||||
error = _("The avalanche proof has duplicated stake."); | error = _("The avalanche proof has duplicated stake."); | ||||
return false; | return false; | ||||
case ProofValidationResult::INVALID_STAKE_SIGNATURE: | case ProofValidationResult::INVALID_STAKE_SIGNATURE: | ||||
error = _("The avalanche proof has invalid stake signatures."); | error = _("The avalanche proof has invalid stake signatures."); | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 901 Lines • Show Last 20 Lines |