mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
trivial: Mark overrides as such.
This trivial change adds the "override" keyword to some methods of subclasses meant to override interface methods. This ensures that any future change to the interface' method signatures which are not correctly mirrored in the subclass will break at compile time with a clear error message, rather than fail at runtime (which is harder to debug).
This commit is contained in:
@@ -25,12 +25,12 @@ struct TestSubscriber : public CValidationInterface {
|
||||
|
||||
TestSubscriber(uint256 tip) : m_expected_tip(tip) {}
|
||||
|
||||
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
|
||||
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override
|
||||
{
|
||||
BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash());
|
||||
}
|
||||
|
||||
void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex, const std::vector<CTransactionRef>& txnConflicted)
|
||||
void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex, const std::vector<CTransactionRef>& txnConflicted) override
|
||||
{
|
||||
BOOST_CHECK_EQUAL(m_expected_tip, block->hashPrevBlock);
|
||||
BOOST_CHECK_EQUAL(m_expected_tip, pindex->pprev->GetBlockHash());
|
||||
@@ -38,7 +38,7 @@ struct TestSubscriber : public CValidationInterface {
|
||||
m_expected_tip = block->GetHash();
|
||||
}
|
||||
|
||||
void BlockDisconnected(const std::shared_ptr<const CBlock>& block)
|
||||
void BlockDisconnected(const std::shared_ptr<const CBlock>& block) override
|
||||
{
|
||||
BOOST_CHECK_EQUAL(m_expected_tip, block->GetHash());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user