Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bitcoinrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2613,7 +2613,7 @@ Value getauxblock(const Array& params, bool fHelp)
hash.SetHex(params[0].get_str());
vector<unsigned char> vchAuxPow = ParseHex(params[1].get_str());
CDataStream ss(vchAuxPow, SER_GETHASH | SER_BLOCKHEADERONLY);
CAuxPow* pow = new CAuxPow(algo);
auto* pow = new CAuxPow(algo);
ss >> *pow;
if (!mapNewBlockSCRYPT.count(hash))
return ::error("getauxblock() : block not found");
Expand Down Expand Up @@ -2692,7 +2692,7 @@ Value getauxblock(const Array& params, bool fHelp)
hash.SetHex(params[0].get_str());
vector<unsigned char> vchAuxPow = ParseHex(params[1].get_str());
CDataStream ss(vchAuxPow, SER_GETHASH | SER_BLOCKHEADERONLY);
CAuxPow* pow = new CAuxPow(algo);
auto* pow = new CAuxPow(algo);
ss >> *pow;
if (!mapNewBlockSHA256D.count(hash))
return ::error("getauxblock() : block not found");
Expand Down
30 changes: 15 additions & 15 deletions src/cryptopp/cryptlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class CRYPTOPP_DLL OS_Error : public Exception
public:
OS_Error(ErrorType errorType, const std::string &s, const std::string& operation, int errorCode)
: Exception(errorType, s), m_operation(operation), m_errorCode(errorCode) {}
~OS_Error() throw() {}
~OS_Error() throw() override override override {}

// the operating system API that reported the error
const std::string & GetOperation() const {return m_operation;}
Expand Down Expand Up @@ -615,21 +615,21 @@ typedef HashTransformation HashFunction;
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockCipher : public SimpleKeyingInterface, public BlockTransformation
{
protected:
const Algorithm & GetAlgorithm() const {return *this;}
const Algorithm & GetAlgorithm() const override override override {return *this;}
};

//! interface for one direction (encryption or decryption) of a stream cipher or cipher mode
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SymmetricCipher : public SimpleKeyingInterface, public StreamTransformation
{
protected:
const Algorithm & GetAlgorithm() const {return *this;}
const Algorithm & GetAlgorithm() const override override override {return *this;}
};

//! interface for message authentication codes
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE MessageAuthenticationCode : public SimpleKeyingInterface, public HashTransformation
{
protected:
const Algorithm & GetAlgorithm() const {return *this;}
const Algorithm & GetAlgorithm() const override override override {return *this;}
};

//! interface for for one direction (encryption or decryption) of a stream cipher or block cipher mode with authentication
Expand Down Expand Up @@ -666,7 +666,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipher : public Mess
virtual std::string AlgorithmName() const =0;

protected:
const Algorithm & GetAlgorithm() const {return *static_cast<const MessageAuthenticationCode *>(this);}
const Algorithm & GetAlgorithm() const override override override {return *static_cast<const MessageAuthenticationCode *>(this);}
virtual void UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength) {}
};

Expand Down Expand Up @@ -837,8 +837,8 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm,

//! \name WAITING
//@{
unsigned int GetMaxWaitObjectCount() const;
void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack);
unsigned int GetMaxWaitObjectCount() const override override override;
void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) override override override;
//@}

//! \name SIGNALS
Expand Down Expand Up @@ -1166,8 +1166,8 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKeyAlgorithm : public AsymmetricAlgo
{
public:
// VC60 workaround: no co-variant return type
CryptoMaterial & AccessMaterial() {return AccessPublicKey();}
const CryptoMaterial & GetMaterial() const {return GetPublicKey();}
CryptoMaterial & AccessMaterial() override override override {return AccessPublicKey();}
const CryptoMaterial & GetMaterial() const override override override {return GetPublicKey();}

virtual PublicKey & AccessPublicKey() =0;
virtual const PublicKey & GetPublicKey() const {return const_cast<PublicKeyAlgorithm *>(this)->AccessPublicKey();}
Expand All @@ -1178,8 +1178,8 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKeyAlgorithm : public AsymmetricAlgo
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKeyAlgorithm : public AsymmetricAlgorithm
{
public:
CryptoMaterial & AccessMaterial() {return AccessPrivateKey();}
const CryptoMaterial & GetMaterial() const {return GetPrivateKey();}
CryptoMaterial & AccessMaterial() override override override {return AccessPrivateKey();}
const CryptoMaterial & GetMaterial() const override override override {return GetPrivateKey();}

virtual PrivateKey & AccessPrivateKey() =0;
virtual const PrivateKey & GetPrivateKey() const {return const_cast<PrivateKeyAlgorithm *>(this)->AccessPrivateKey();}
Expand All @@ -1190,8 +1190,8 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKeyAlgorithm : public AsymmetricAlg
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE KeyAgreementAlgorithm : public AsymmetricAlgorithm
{
public:
CryptoMaterial & AccessMaterial() {return AccessCryptoParameters();}
const CryptoMaterial & GetMaterial() const {return GetCryptoParameters();}
CryptoMaterial & AccessMaterial() override override override {return AccessCryptoParameters();}
const CryptoMaterial & GetMaterial() const override override override {return GetCryptoParameters();}

virtual CryptoParameters & AccessCryptoParameters() =0;
virtual const CryptoParameters & GetCryptoParameters() const {return const_cast<KeyAgreementAlgorithm *>(this)->AccessCryptoParameters();}
Expand Down Expand Up @@ -1348,10 +1348,10 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_MessageAccumulator : public HashTransfo
{
public:
//! should not be called on PK_MessageAccumulator
unsigned int DigestSize() const
unsigned int DigestSize() const override override override
{throw NotImplemented("PK_MessageAccumulator: DigestSize() should not be called");}
//! should not be called on PK_MessageAccumulator
void TruncatedFinal(byte *digest, size_t digestSize)
void TruncatedFinal(byte *digest, size_t digestSize) override override override
{throw NotImplemented("PK_MessageAccumulator: TruncatedFinal() should not be called");}
};

Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/smartptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ template <class T> class vector_member_ptrs
size_t size() const {return this->m_size;}
void resize(size_t newSize)
{
member_ptr<T> *newPtr = new member_ptr<T>[newSize];
autober_ptr<T>[newSize];
for (size_t i=0; i<this->m_size && i<newSize; i++)
newPtr[i].reset(this->m_ptr[i].release());
delete [] this->m_ptr;
Expand Down
4 changes: 2 additions & 2 deletions src/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ bool CDB::Rewrite(const string& strFile)
string strFileRes = strFile + ".rewrite";
{ // surround usage of db with extra {}
CDB db(strFile.c_str(), "r");
Db* pdbCopy = new Db(&dbenv, 0);
auto* pdbCopy = new Db(&dbenv, 0);

int ret = pdbCopy->open(NULL, // Txn pointer
strFileRes.c_str(), // Filename
Expand Down Expand Up @@ -557,7 +557,7 @@ CBlockIndex static * InsertBlockIndex(uint256 hash)
return (*mi).second;

// Create new
CBlockIndex* pindexNew = new CBlockIndex();
auto* pindexNew = new CBlockIndex();
if (!pindexNew)
throw runtime_error("LoadBlockIndex() : new CBlockIndex failed");
mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;
Expand Down
2 changes: 1 addition & 1 deletion src/gamedb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class GameStepValidator
GameStepValidator(DatabaseSet& dbset, CBlockIndex *pindex)
: fOwnState(true), fOwnDb(false), pdbset(&dbset)
{
GameState *newState = new GameState;
auto *newState = new GameState;
if (!GetGameState (dbset, pindex, *newState))
{
delete newState;
Expand Down
50 changes: 25 additions & 25 deletions src/huntercoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,47 +69,47 @@ uint256 hashHuntercoinGenesisBlock[2] = {
class CHuntercoinHooks : public CHooks
{
public:
virtual bool IsStandard(const CScript& scriptPubKey);
virtual void AddToWallet(CWalletTx& tx);
virtual bool CheckTransaction(const CTransaction& tx);
virtual bool ConnectInputs(DatabaseSet& dbset, const CTestPool& testPool,
bool IsStandard(const CScript& scriptPubKey) override;
void AddToWallet(CWalletTx& tx) override;
bool CheckTransaction(const CTransaction& tx) override;
bool ConnectInputs(DatabaseSet& dbset, const CTestPool& testPool,
const CTransaction& tx,
const std::vector<CUtxoEntry>& vTxoPrev,
const CBlockIndex* pindexBlock,
const CDiskTxPos& txPos,
bool fBlock,
bool fMiner);
virtual bool DisconnectInputs (DatabaseSet& dbset,
bool fMiner) override;
bool DisconnectInputs (DatabaseSet& dbset,
const CTransaction& tx,
CBlockIndex* pindexBlock);
virtual bool ConnectBlock (CBlock& block, DatabaseSet& txdb,
CBlockIndex* pindexBlock) override;
bool ConnectBlock (CBlock& block, DatabaseSet& txdb,
CBlockIndex* pindex, int64 &nFees,
unsigned int nPosAfterTx);
virtual void NewBlockAdded ();
virtual bool DisconnectBlock (CBlock& block, DatabaseSet& txdb,
CBlockIndex* pindex);
virtual bool ExtractAddress(const CScript& script, string& address);
virtual bool GenesisBlock(CBlock& block);
virtual bool Lockin(int nHeight, uint256 hash);
virtual int LockinHeight();
unsigned int nPosAfterTx) override;
void NewBlockAdded () override;
bool DisconnectBlock (CBlock& block, DatabaseSet& txdb,
CBlockIndex* pindex) override;
bool ExtractAddress(const CScript& script, string& address) override;
bool GenesisBlock(CBlock& block) override;
bool Lockin(int nHeight, uint256 hash) override;
int LockinHeight() override;
virtual string IrcPrefix();
virtual bool AcceptToMemoryPool (DatabaseSet& dbset,
const CTransaction& tx);
virtual void RemoveFromMemoryPool (const CTransaction& tx);
bool AcceptToMemoryPool (DatabaseSet& dbset,
const CTransaction& tx) override;
void RemoveFromMemoryPool (const CTransaction& tx) override;

virtual void MessageStart(char* pchMessageStart)
void MessageStart(char* pchMessageStart) override
{
// Make the message start different
pchMessageStart[3] = 0xfe;
}
virtual bool IsMine(const CTransaction& tx);
virtual bool IsMine(const CTransaction& tx, const CTxOut& txout, bool ignore_name_new = false);
bool IsMine(const CTransaction& tx) override;
bool IsMine(const CTransaction& tx, const CTxOut& txout, bool ignore_name_new = false) override;

virtual void GetMinFee(int64 &nMinFee, int64 &nBaseFee, const CTransaction &tx,
void GetMinFee(int64 &nMinFee, int64 &nBaseFee, const CTransaction &tx,
unsigned int nBlockSize, bool fAllowFree, bool fForRelay,
unsigned int nBytes, unsigned int nNewBlockSize);
unsigned int nBytes, unsigned int nNewBlockSize) override;

virtual bool CheckFees (const CTransaction& tx, int64 nFees);
bool CheckFees (const CTransaction& tx, int64 nFees) override;

string GetAlertPubkey1()
{
Expand Down
2 changes: 1 addition & 1 deletion src/json/json_spirit_reader_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ namespace json_spirit

mtx_parser.lock();
Semantic_actions< Value_type, Iter_type > semantic_actions( value );
Json_grammer< Value_type, Iter_type > *jg = new Json_grammer< Value_type, Iter_type>( semantic_actions );
auto);
const spirit_namespace::parse_info< Iter_type > info =
spirit_namespace::parse( begin, end, *jg,
spirit_namespace::space_p );
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@ bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos)
return error("AddToBlockIndex() : %s already exists", hash.ToString().substr(0,20).c_str());

// Construct new block index object
CBlockIndex* pindexNew = new CBlockIndex(nFile, nBlockPos, *this);
auto* pindexNew = new CBlockIndex(nFile, nBlockPos, *this);
if (!pindexNew)
return error("AddToBlockIndex() : new CBlockIndex failed");
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;
Expand Down Expand Up @@ -1950,7 +1950,7 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
if (!mapBlockIndex.count(pblock->hashPrevBlock))
{
printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", pblock->hashPrevBlock.ToString().substr(0,20).c_str());
CBlock* pblock2 = new CBlock(*pblock);
auto* pblock2 = new CBlock(*pblock);
mapOrphanBlocks.insert(make_pair(hash, pblock2));
mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrevBlock, pblock2));

Expand Down
4 changes: 2 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ CNode* ConnectNode(CAddress addrConnect, int64 nTimeout)
#endif

// Add node
CNode* pnode = new CNode(hSocket, addrConnect, false);
auto* pnode = new CNode(hSocket, addrConnect, false);
if (nTimeout != 0)
pnode->AddRef(nTimeout);
else
Expand Down Expand Up @@ -901,7 +901,7 @@ void ThreadSocketHandler2(void* parg)
else
{
printf("accepted connection %s\n", addr.ToString().c_str());
CNode* pnode = new CNode(hSocket, addr, true);
auto* pnode = new CNode(hSocket, addr, true);
pnode->AddRef();
CRITICAL_BLOCK(cs_vNodes)
vNodes.push_back(pnode);
Expand Down
6 changes: 3 additions & 3 deletions src/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class CWallet : public CKeyStore
std::vector<unsigned char> vchDefaultKey;

// Adds a key to the store, and saves it to disk.
bool AddKey(const CKey& key);
bool AddKey(const CKey& key) override override override override override override override override override override override override override override override override override;
// Adds a watching address to the store, saves it to disk.
bool AddAddress(const uint160& hash160);
bool AddAddress(const uint160& hash160) override override override override override override override override override override override override override override override override override;
// Adds a key to the store, without saving it to disk (used by LoadWallet)
bool LoadKey(const CKey& key) { return CKeyStore::AddKey(key); }
// Adds a watching address to the store, without saving it to disk (used by LoadWallet)
Expand Down Expand Up @@ -259,7 +259,7 @@ class CWallet : public CKeyStore
bool EncryptWallet(const SecureString& strWalletPassphrase);

// Adds an encrypted key to the store, and saves it to disk.
bool AddCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
bool AddCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) override override override override override override override override override override override override override override;
// Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)
bool LoadCryptedKey(const std::vector<unsigned char> &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) { /*SetMinVersion(FEATURE_WALLETCRYPT);*/ return CKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret); }

Expand Down