ban peers sending bad pow outright

PoW is expensive to verify, so be strict
This commit is contained in:
moneromooo-monero 2019-09-24 13:08:25 +00:00
parent faf5805fc0
commit 3455efafa8
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
9 changed files with 25 additions and 15 deletions

View file

@ -1689,6 +1689,7 @@ bool Blockchain::handle_alternative_block(const block& b, const crypto::hash& id
{
MERROR_VER("Block with id: " << id << std::endl << " for alternative chain, does not have enough proof of work: " << proof_of_work << std::endl << " expected difficulty: " << current_diff);
bvc.m_verifivation_failed = true;
bvc.m_bad_pow = true;
return false;
}
@ -3620,6 +3621,7 @@ leave:
{
MERROR_VER("Block with id: " << id << std::endl << "does not have enough proof of work: " << proof_of_work << " at height " << blockchain_height << ", unexpected difficulty: " << current_diffic);
bvc.m_verifivation_failed = true;
bvc.m_bad_pow = true;
goto leave;
}
}