mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
Use the override specifier (C++11) where we expect to be overriding the virtual function of a base class
This commit is contained in:
@@ -27,7 +27,7 @@ public:
|
||||
insecure_rand = FastRandomContext(true);
|
||||
}
|
||||
|
||||
int RandomInt(int nMax)
|
||||
int RandomInt(int nMax) override
|
||||
{
|
||||
state = (CHashWriter(SER_GETHASH, 0) << state).GetHash().GetCheapHash();
|
||||
return (unsigned int)(state % nMax);
|
||||
|
||||
@@ -131,7 +131,7 @@ class TestLockedPageAllocator: public LockedPageAllocator
|
||||
{
|
||||
public:
|
||||
TestLockedPageAllocator(int count_in, int lockedcount_in): count(count_in), lockedcount(lockedcount_in) {}
|
||||
void* AllocateLocked(size_t len, bool *lockingSuccess)
|
||||
void* AllocateLocked(size_t len, bool *lockingSuccess) override
|
||||
{
|
||||
*lockingSuccess = false;
|
||||
if (count > 0) {
|
||||
@@ -146,10 +146,10 @@ public:
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
void FreeLocked(void* addr, size_t len)
|
||||
void FreeLocked(void* addr, size_t len) override
|
||||
{
|
||||
}
|
||||
size_t GetLimit()
|
||||
size_t GetLimit() override
|
||||
{
|
||||
return std::numeric_limits<size_t>::max();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
class CAddrManUncorrupted : public CAddrManSerializationMock
|
||||
{
|
||||
public:
|
||||
void Serialize(CDataStream& s) const
|
||||
void Serialize(CDataStream& s) const override
|
||||
{
|
||||
CAddrMan::Serialize(s);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
class CAddrManCorrupted : public CAddrManSerializationMock
|
||||
{
|
||||
public:
|
||||
void Serialize(CDataStream& s) const
|
||||
void Serialize(CDataStream& s) const override
|
||||
{
|
||||
// Produces corrupt output that claims addrman has 20 addrs when it only has one addr.
|
||||
unsigned char nVersion = 1;
|
||||
|
||||
@@ -22,11 +22,11 @@ private:
|
||||
mutable ThresholdConditionCache cache;
|
||||
|
||||
public:
|
||||
int64_t BeginTime(const Consensus::Params& params) const { return TestTime(10000); }
|
||||
int64_t EndTime(const Consensus::Params& params) const { return TestTime(20000); }
|
||||
int Period(const Consensus::Params& params) const { return 1000; }
|
||||
int Threshold(const Consensus::Params& params) const { return 900; }
|
||||
bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const { return (pindex->nVersion & 0x100); }
|
||||
int64_t BeginTime(const Consensus::Params& params) const override { return TestTime(10000); }
|
||||
int64_t EndTime(const Consensus::Params& params) const override { return TestTime(20000); }
|
||||
int Period(const Consensus::Params& params) const override { return 1000; }
|
||||
int Threshold(const Consensus::Params& params) const override { return 900; }
|
||||
bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override { return (pindex->nVersion & 0x100); }
|
||||
|
||||
ThresholdState GetStateFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateFor(pindexPrev, paramsDummy, cache); }
|
||||
int GetStateSinceHeightFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateSinceHeightFor(pindexPrev, paramsDummy, cache); }
|
||||
|
||||
Reference in New Issue
Block a user