Skip to content

Commit

Permalink
consensus: Check if block signature is canonical in ProcessNewBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Jan 7, 2024
1 parent a219248 commit e7112d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4230,6 +4230,10 @@ bool ChainstateManager::ProcessNewBlock(const std::shared_ptr<const CBlock>& blo
// malleability that cause CheckBlock() to fail; see e.g. CVE-2012-2459 and
// https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-February/016697.html. Because CheckBlock() is
// not very expensive, the anti-DoS benefits of caching failure (of a definitely-invalid block) are not substantial.
// Blackcoin: also check for the signature encoding
if (!CheckCanonicalBlockSignature(block)) {
return error("%s: AcceptBlock FAILED (%s)", __func__, "bad block signature encoding");
}
bool ret = CheckBlock(*block, state, GetConsensus(), ActiveChainstate());
if (ret) {
// Store to disk
Expand Down

0 comments on commit e7112d7

Please sign in to comment.