Declare single-argument (non-converting) constructors "explicit"
In order to avoid unintended implicit conversions.
This commit is contained in:
parent
22e301a3d5
commit
64fb0ac016
68 changed files with 105 additions and 105 deletions
|
@ -37,7 +37,7 @@ public:
|
||||||
SetNull();
|
SetNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
CBanEntry(int64_t nCreateTimeIn)
|
explicit CBanEntry(int64_t nCreateTimeIn)
|
||||||
{
|
{
|
||||||
SetNull();
|
SetNull();
|
||||||
nCreateTime = nCreateTimeIn;
|
nCreateTime = nCreateTimeIn;
|
||||||
|
|
|
@ -218,7 +218,7 @@ private:
|
||||||
CBitcoinAddress* addr;
|
CBitcoinAddress* addr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CBitcoinAddressVisitor(CBitcoinAddress* addrIn) : addr(addrIn) {}
|
explicit CBitcoinAddressVisitor(CBitcoinAddress* addrIn) : addr(addrIn) {}
|
||||||
|
|
||||||
bool operator()(const CKeyID& id) const { return addr->Set(id); }
|
bool operator()(const CKeyID& id) const { return addr->Set(id); }
|
||||||
bool operator()(const CScriptID& id) const { return addr->Set(id); }
|
bool operator()(const CScriptID& id) const { return addr->Set(id); }
|
||||||
|
|
|
@ -67,7 +67,7 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::State& state)
|
||||||
prevector<PREVECTOR_SIZE, uint8_t> p;
|
prevector<PREVECTOR_SIZE, uint8_t> p;
|
||||||
PrevectorJob(){
|
PrevectorJob(){
|
||||||
}
|
}
|
||||||
PrevectorJob(FastRandomContext& insecure_rand){
|
explicit PrevectorJob(FastRandomContext& insecure_rand){
|
||||||
p.resize(insecure_rand.randrange(PREVECTOR_SIZE*2));
|
p.resize(insecure_rand.randrange(PREVECTOR_SIZE*2));
|
||||||
}
|
}
|
||||||
bool operator()()
|
bool operator()()
|
||||||
|
|
|
@ -16,7 +16,7 @@ struct TransactionCompressor {
|
||||||
private:
|
private:
|
||||||
CTransactionRef& tx;
|
CTransactionRef& tx;
|
||||||
public:
|
public:
|
||||||
TransactionCompressor(CTransactionRef& txIn) : tx(txIn) {}
|
explicit TransactionCompressor(CTransactionRef& txIn) : tx(txIn) {}
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public:
|
||||||
std::vector<CTransactionRef> txn;
|
std::vector<CTransactionRef> txn;
|
||||||
|
|
||||||
BlockTransactions() {}
|
BlockTransactions() {}
|
||||||
BlockTransactions(const BlockTransactionsRequest& req) :
|
explicit BlockTransactions(const BlockTransactionsRequest& req) :
|
||||||
blockhash(req.blockhash), txn(req.indexes.size()) {}
|
blockhash(req.blockhash), txn(req.indexes.size()) {}
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
@ -198,7 +198,7 @@ protected:
|
||||||
CTxMemPool* pool;
|
CTxMemPool* pool;
|
||||||
public:
|
public:
|
||||||
CBlockHeader header;
|
CBlockHeader header;
|
||||||
PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {}
|
explicit PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {}
|
||||||
|
|
||||||
// extra_txn is a list of extra transactions to look at, in <witness hash, reference> form
|
// extra_txn is a list of extra transactions to look at, in <witness hash, reference> form
|
||||||
ReadStatus InitData(const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<std::pair<uint256, CTransactionRef>>& extra_txn);
|
ReadStatus InitData(const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<std::pair<uint256, CTransactionRef>>& extra_txn);
|
||||||
|
|
|
@ -247,7 +247,7 @@ public:
|
||||||
SetNull();
|
SetNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
CBlockIndex(const CBlockHeader& block)
|
explicit CBlockIndex(const CBlockHeader& block)
|
||||||
{
|
{
|
||||||
SetNull();
|
SetNull();
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ public:
|
||||||
boost::mutex ControlMutex;
|
boost::mutex ControlMutex;
|
||||||
|
|
||||||
//! Create a new check queue
|
//! Create a new check queue
|
||||||
CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), fQuit(false), nBatchSize(nBatchSizeIn) {}
|
explicit CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), fQuit(false), nBatchSize(nBatchSizeIn) {}
|
||||||
|
|
||||||
//! Worker thread
|
//! Worker thread
|
||||||
void Thread()
|
void Thread()
|
||||||
|
|
|
@ -53,7 +53,7 @@ protected:
|
||||||
unsigned int GetSpecialSize(unsigned int nSize) const;
|
unsigned int GetSpecialSize(unsigned int nSize) const;
|
||||||
bool Decompress(unsigned int nSize, const std::vector<unsigned char> &out);
|
bool Decompress(unsigned int nSize, const std::vector<unsigned char> &out);
|
||||||
public:
|
public:
|
||||||
CScriptCompressor(CScript &scriptIn) : script(scriptIn) { }
|
explicit CScriptCompressor(CScript &scriptIn) : script(scriptIn) { }
|
||||||
|
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
void Serialize(Stream &s) const {
|
void Serialize(Stream &s) const {
|
||||||
|
@ -99,7 +99,7 @@ public:
|
||||||
static uint64_t CompressAmount(uint64_t nAmount);
|
static uint64_t CompressAmount(uint64_t nAmount);
|
||||||
static uint64_t DecompressAmount(uint64_t nAmount);
|
static uint64_t DecompressAmount(uint64_t nAmount);
|
||||||
|
|
||||||
CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
|
explicit CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ private:
|
||||||
AES128_ctx ctx;
|
AES128_ctx ctx;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AES128Encrypt(const unsigned char key[16]);
|
explicit AES128Encrypt(const unsigned char key[16]);
|
||||||
~AES128Encrypt();
|
~AES128Encrypt();
|
||||||
void Encrypt(unsigned char ciphertext[16], const unsigned char plaintext[16]) const;
|
void Encrypt(unsigned char ciphertext[16], const unsigned char plaintext[16]) const;
|
||||||
};
|
};
|
||||||
|
@ -34,7 +34,7 @@ private:
|
||||||
AES128_ctx ctx;
|
AES128_ctx ctx;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AES128Decrypt(const unsigned char key[16]);
|
explicit AES128Decrypt(const unsigned char key[16]);
|
||||||
~AES128Decrypt();
|
~AES128Decrypt();
|
||||||
void Decrypt(unsigned char plaintext[16], const unsigned char ciphertext[16]) const;
|
void Decrypt(unsigned char plaintext[16], const unsigned char ciphertext[16]) const;
|
||||||
};
|
};
|
||||||
|
@ -46,7 +46,7 @@ private:
|
||||||
AES256_ctx ctx;
|
AES256_ctx ctx;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AES256Encrypt(const unsigned char key[32]);
|
explicit AES256Encrypt(const unsigned char key[32]);
|
||||||
~AES256Encrypt();
|
~AES256Encrypt();
|
||||||
void Encrypt(unsigned char ciphertext[16], const unsigned char plaintext[16]) const;
|
void Encrypt(unsigned char ciphertext[16], const unsigned char plaintext[16]) const;
|
||||||
};
|
};
|
||||||
|
@ -58,7 +58,7 @@ private:
|
||||||
AES256_ctx ctx;
|
AES256_ctx ctx;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AES256Decrypt(const unsigned char key[32]);
|
explicit AES256Decrypt(const unsigned char key[32]);
|
||||||
~AES256Decrypt();
|
~AES256Decrypt();
|
||||||
void Decrypt(unsigned char plaintext[16], const unsigned char ciphertext[16]) const;
|
void Decrypt(unsigned char plaintext[16], const unsigned char ciphertext[16]) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
* @post All calls to bit_is_set (without subsequent bit_unset) will return
|
* @post All calls to bit_is_set (without subsequent bit_unset) will return
|
||||||
* true.
|
* true.
|
||||||
*/
|
*/
|
||||||
bit_packed_atomic_flags(uint32_t size)
|
explicit bit_packed_atomic_flags(uint32_t size)
|
||||||
{
|
{
|
||||||
// pad out the size if needed
|
// pad out the size if needed
|
||||||
size = (size + 7) / 8;
|
size = (size + 7) / 8;
|
||||||
|
|
|
@ -22,7 +22,7 @@ static const size_t DBWRAPPER_PREALLOC_VALUE_SIZE = 1024;
|
||||||
class dbwrapper_error : public std::runtime_error
|
class dbwrapper_error : public std::runtime_error
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
dbwrapper_error(const std::string& msg) : std::runtime_error(msg) {}
|
explicit dbwrapper_error(const std::string& msg) : std::runtime_error(msg) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CDBWrapper;
|
class CDBWrapper;
|
||||||
|
@ -61,7 +61,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @param[in] _parent CDBWrapper that this batch is to be submitted to
|
* @param[in] _parent CDBWrapper that this batch is to be submitted to
|
||||||
*/
|
*/
|
||||||
CDBBatch(const CDBWrapper &_parent) : parent(_parent), ssKey(SER_DISK, CLIENT_VERSION), ssValue(SER_DISK, CLIENT_VERSION), size_estimate(0) { };
|
explicit CDBBatch(const CDBWrapper &_parent) : parent(_parent), ssKey(SER_DISK, CLIENT_VERSION), ssValue(SER_DISK, CLIENT_VERSION), size_estimate(0) { };
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
|
|
|
@ -168,7 +168,7 @@ private:
|
||||||
Source* source;
|
Source* source;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CHashVerifier(Source* source_) : CHashWriter(source_->GetType(), source_->GetVersion()), source(source_) {}
|
explicit CHashVerifier(Source* source_) : CHashWriter(source_->GetType(), source_->GetVersion()), source(source_) {}
|
||||||
|
|
||||||
void read(char* pch, size_t nSize)
|
void read(char* pch, size_t nSize)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ private:
|
||||||
class HTTPRPCTimerInterface : public RPCTimerInterface
|
class HTTPRPCTimerInterface : public RPCTimerInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HTTPRPCTimerInterface(struct event_base* _base) : base(_base)
|
explicit HTTPRPCTimerInterface(struct event_base* _base) : base(_base)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
const char* Name() override
|
const char* Name() override
|
||||||
|
|
|
@ -79,7 +79,7 @@ private:
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WorkQueue &wq;
|
WorkQueue &wq;
|
||||||
ThreadCounter(WorkQueue &w): wq(w)
|
explicit ThreadCounter(WorkQueue &w): wq(w)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(wq.cs);
|
std::lock_guard<std::mutex> lock(wq.cs);
|
||||||
wq.numThreads += 1;
|
wq.numThreads += 1;
|
||||||
|
@ -93,7 +93,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WorkQueue(size_t _maxDepth) : running(true),
|
explicit WorkQueue(size_t _maxDepth) : running(true),
|
||||||
maxDepth(_maxDepth),
|
maxDepth(_maxDepth),
|
||||||
numThreads(0)
|
numThreads(0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,7 +61,7 @@ private:
|
||||||
bool replySent;
|
bool replySent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HTTPRequest(struct evhttp_request* req);
|
explicit HTTPRequest(struct evhttp_request* req);
|
||||||
~HTTPRequest();
|
~HTTPRequest();
|
||||||
|
|
||||||
enum RequestMethod {
|
enum RequestMethod {
|
||||||
|
|
|
@ -136,7 +136,7 @@ bool ShutdownRequested()
|
||||||
class CCoinsViewErrorCatcher : public CCoinsViewBacked
|
class CCoinsViewErrorCatcher : public CCoinsViewBacked
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CCoinsViewErrorCatcher(CCoinsView* view) : CCoinsViewBacked(view) {}
|
explicit CCoinsViewErrorCatcher(CCoinsView* view) : CCoinsViewBacked(view) {}
|
||||||
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override {
|
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override {
|
||||||
try {
|
try {
|
||||||
return CCoinsViewBacked::GetCoin(outpoint, coin);
|
return CCoinsViewBacked::GetCoin(outpoint, coin);
|
||||||
|
|
|
@ -27,7 +27,7 @@ protected:
|
||||||
size_type nMaxSize;
|
size_type nMaxSize;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
limitedmap(size_type nMaxSizeIn)
|
explicit limitedmap(size_type nMaxSizeIn)
|
||||||
{
|
{
|
||||||
assert(nMaxSizeIn > 0);
|
assert(nMaxSizeIn > 0);
|
||||||
nMaxSize = nMaxSizeIn;
|
nMaxSize = nMaxSizeIn;
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct CBlockTemplate
|
||||||
// Container for tracking updates to ancestor feerate as we include (parent)
|
// Container for tracking updates to ancestor feerate as we include (parent)
|
||||||
// transactions in a block
|
// transactions in a block
|
||||||
struct CTxMemPoolModifiedEntry {
|
struct CTxMemPoolModifiedEntry {
|
||||||
CTxMemPoolModifiedEntry(CTxMemPool::txiter entry)
|
explicit CTxMemPoolModifiedEntry(CTxMemPool::txiter entry)
|
||||||
{
|
{
|
||||||
iter = entry;
|
iter = entry;
|
||||||
nSizeWithAncestors = entry->GetSizeWithAncestors();
|
nSizeWithAncestors = entry->GetSizeWithAncestors();
|
||||||
|
@ -116,7 +116,7 @@ typedef indexed_modified_transaction_set::index<ancestor_score>::type::iterator
|
||||||
|
|
||||||
struct update_for_parent_inclusion
|
struct update_for_parent_inclusion
|
||||||
{
|
{
|
||||||
update_for_parent_inclusion(CTxMemPool::txiter it) : iter(it) {}
|
explicit update_for_parent_inclusion(CTxMemPool::txiter it) : iter(it) {}
|
||||||
|
|
||||||
void operator() (CTxMemPoolModifiedEntry &e)
|
void operator() (CTxMemPoolModifiedEntry &e)
|
||||||
{
|
{
|
||||||
|
@ -164,7 +164,7 @@ public:
|
||||||
CFeeRate blockMinFeeRate;
|
CFeeRate blockMinFeeRate;
|
||||||
};
|
};
|
||||||
|
|
||||||
BlockAssembler(const CChainParams& params);
|
explicit BlockAssembler(const CChainParams& params);
|
||||||
BlockAssembler(const CChainParams& params, const Options& options);
|
BlockAssembler(const CChainParams& params, const Options& options);
|
||||||
|
|
||||||
/** Construct a new block template with coinbase to scriptPubKeyIn */
|
/** Construct a new block template with coinbase to scriptPubKeyIn */
|
||||||
|
|
|
@ -2783,7 +2783,7 @@ class CompareInvMempoolOrder
|
||||||
{
|
{
|
||||||
CTxMemPool *mp;
|
CTxMemPool *mp;
|
||||||
public:
|
public:
|
||||||
CompareInvMempoolOrder(CTxMemPool *_mempool)
|
explicit CompareInvMempoolOrder(CTxMemPool *_mempool)
|
||||||
{
|
{
|
||||||
mp = _mempool;
|
mp = _mempool;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ private:
|
||||||
CConnman* connman;
|
CConnman* connman;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PeerLogicValidation(CConnman* connmanIn);
|
explicit PeerLogicValidation(CConnman* connmanIn);
|
||||||
|
|
||||||
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;
|
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;
|
||||||
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
|
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
|
||||||
|
|
|
@ -36,7 +36,7 @@ class CNetAddr
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CNetAddr();
|
CNetAddr();
|
||||||
CNetAddr(const struct in_addr& ipv4Addr);
|
explicit CNetAddr(const struct in_addr& ipv4Addr);
|
||||||
void Init();
|
void Init();
|
||||||
void SetIP(const CNetAddr& ip);
|
void SetIP(const CNetAddr& ip);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class CNetAddr
|
||||||
std::vector<unsigned char> GetGroup() const;
|
std::vector<unsigned char> GetGroup() const;
|
||||||
int GetReachabilityFrom(const CNetAddr *paddrPartner = nullptr) const;
|
int GetReachabilityFrom(const CNetAddr *paddrPartner = nullptr) const;
|
||||||
|
|
||||||
CNetAddr(const struct in6_addr& pipv6Addr, const uint32_t scope = 0);
|
explicit CNetAddr(const struct in6_addr& pipv6Addr, const uint32_t scope = 0);
|
||||||
bool GetIn6Addr(struct in6_addr* pipv6Addr) const;
|
bool GetIn6Addr(struct in6_addr* pipv6Addr) const;
|
||||||
|
|
||||||
friend bool operator==(const CNetAddr& a, const CNetAddr& b);
|
friend bool operator==(const CNetAddr& a, const CNetAddr& b);
|
||||||
|
@ -146,7 +146,7 @@ class CService : public CNetAddr
|
||||||
CService();
|
CService();
|
||||||
CService(const CNetAddr& ip, unsigned short port);
|
CService(const CNetAddr& ip, unsigned short port);
|
||||||
CService(const struct in_addr& ipv4Addr, unsigned short port);
|
CService(const struct in_addr& ipv4Addr, unsigned short port);
|
||||||
CService(const struct sockaddr_in& addr);
|
explicit CService(const struct sockaddr_in& addr);
|
||||||
void Init();
|
void Init();
|
||||||
unsigned short GetPort() const;
|
unsigned short GetPort() const;
|
||||||
bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const;
|
bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const;
|
||||||
|
@ -160,7 +160,7 @@ class CService : public CNetAddr
|
||||||
std::string ToStringIPPort() const;
|
std::string ToStringIPPort() const;
|
||||||
|
|
||||||
CService(const struct in6_addr& ipv6Addr, unsigned short port);
|
CService(const struct in6_addr& ipv6Addr, unsigned short port);
|
||||||
CService(const struct sockaddr_in6& addr);
|
explicit CService(const struct sockaddr_in6& addr);
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class proxyType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
proxyType(): randomize_credentials(false) {}
|
proxyType(): randomize_credentials(false) {}
|
||||||
proxyType(const CService &_proxy, bool _randomize_credentials=false): proxy(_proxy), randomize_credentials(_randomize_credentials) {}
|
explicit proxyType(const CService &_proxy, bool _randomize_credentials=false): proxy(_proxy), randomize_credentials(_randomize_credentials) {}
|
||||||
|
|
||||||
bool IsValid() const { return proxy.IsValid(); }
|
bool IsValid() const { return proxy.IsValid(); }
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
class CNetMsgMaker
|
class CNetMsgMaker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CNetMsgMaker(int nVersionIn) : nVersion(nVersionIn){}
|
explicit CNetMsgMaker(int nVersionIn) : nVersion(nVersionIn){}
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
CSerializedNetMsg Make(int nFlags, std::string sCommand, Args&&... args) const
|
CSerializedNetMsg Make(int nFlags, std::string sCommand, Args&&... args) const
|
||||||
|
|
|
@ -284,7 +284,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Create new FeeFilterRounder */
|
/** Create new FeeFilterRounder */
|
||||||
FeeFilterRounder(const CFeeRate& minIncrementalFee);
|
explicit FeeFilterRounder(const CFeeRate& minIncrementalFee);
|
||||||
|
|
||||||
/** Quantize a minimum fee for privacy purpose before broadcast **/
|
/** Quantize a minimum fee for privacy purpose before broadcast **/
|
||||||
CAmount round(CAmount currentMinFee);
|
CAmount round(CAmount currentMinFee);
|
||||||
|
|
|
@ -129,7 +129,7 @@ struct CBlockLocator
|
||||||
|
|
||||||
CBlockLocator() {}
|
CBlockLocator() {}
|
||||||
|
|
||||||
CBlockLocator(const std::vector<uint256>& vHaveIn) : vHave(vHaveIn) {}
|
explicit CBlockLocator(const std::vector<uint256>& vHaveIn) : vHave(vHaveIn) {}
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
};
|
};
|
||||||
typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];
|
typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];
|
||||||
|
|
||||||
CMessageHeader(const MessageStartChars& pchMessageStartIn);
|
explicit CMessageHeader(const MessageStartChars& pchMessageStartIn);
|
||||||
CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn);
|
CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn);
|
||||||
|
|
||||||
std::string GetCommand() const;
|
std::string GetCommand() const;
|
||||||
|
|
|
@ -30,7 +30,7 @@ class CKeyID : public uint160
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CKeyID() : uint160() {}
|
CKeyID() : uint160() {}
|
||||||
CKeyID(const uint160& in) : uint160(in) {}
|
explicit CKeyID(const uint160& in) : uint160(in) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint256 ChainCode;
|
typedef uint256 ChainCode;
|
||||||
|
@ -88,7 +88,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Construct a public key from a byte vector.
|
//! Construct a public key from a byte vector.
|
||||||
CPubKey(const std::vector<unsigned char>& _vch)
|
explicit CPubKey(const std::vector<unsigned char>& _vch)
|
||||||
{
|
{
|
||||||
Set(_vch.begin(), _vch.end());
|
Set(_vch.begin(), _vch.end());
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ class FunctionCallback : public Callback
|
||||||
F f;
|
F f;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FunctionCallback(F f_) : f(std::move(f_)) {}
|
explicit FunctionCallback(F f_) : f(std::move(f_)) {}
|
||||||
~FunctionCallback() override {}
|
~FunctionCallback() override {}
|
||||||
void call() override { f(this); }
|
void call() override { f(this); }
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,9 +30,9 @@ namespace Ui {
|
||||||
class CCoinControlWidgetItem : public QTreeWidgetItem
|
class CCoinControlWidgetItem : public QTreeWidgetItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
|
explicit CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
|
||||||
CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
|
explicit CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
|
||||||
CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
|
explicit CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
|
||||||
|
|
||||||
bool operator<(const QTreeWidgetItem &other) const;
|
bool operator<(const QTreeWidgetItem &other) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,7 +43,7 @@ class FreespaceChecker : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FreespaceChecker(Intro *intro);
|
explicit FreespaceChecker(Intro *intro);
|
||||||
|
|
||||||
enum Status {
|
enum Status {
|
||||||
ST_OK,
|
ST_OK,
|
||||||
|
|
|
@ -93,7 +93,7 @@ class FreedesktopImage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FreedesktopImage() {}
|
FreedesktopImage() {}
|
||||||
FreedesktopImage(const QImage &img);
|
explicit FreedesktopImage(const QImage &img);
|
||||||
|
|
||||||
static int metaType();
|
static int metaType();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class TxViewDelegate : public QAbstractItemDelegate
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
TxViewDelegate(const PlatformStyle *_platformStyle, QObject *parent=nullptr):
|
explicit TxViewDelegate(const PlatformStyle *_platformStyle, QObject *parent=nullptr):
|
||||||
QAbstractItemDelegate(parent), unit(BitcoinUnits::BTC),
|
QAbstractItemDelegate(parent), unit(BitcoinUnits::BTC),
|
||||||
platformStyle(_platformStyle)
|
platformStyle(_platformStyle)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
class SSLVerifyError : public std::runtime_error
|
class SSLVerifyError : public std::runtime_error
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SSLVerifyError(std::string err) : std::runtime_error(err) { }
|
explicit SSLVerifyError(std::string err) : std::runtime_error(err) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
bool PaymentRequestPlus::parse(const QByteArray& data)
|
bool PaymentRequestPlus::parse(const QByteArray& data)
|
||||||
|
|
|
@ -72,7 +72,7 @@ public:
|
||||||
static bool ipcSendCommandLine();
|
static bool ipcSendCommandLine();
|
||||||
|
|
||||||
// parent should be QApplication object
|
// parent should be QApplication object
|
||||||
PaymentServer(QObject* parent, bool startLocalServer = true);
|
explicit PaymentServer(QObject* parent, bool startLocalServer = true);
|
||||||
~PaymentServer();
|
~PaymentServer();
|
||||||
|
|
||||||
// Load root certificate authorities. Pass nullptr (default)
|
// Load root certificate authorities. Pass nullptr (default)
|
||||||
|
|
|
@ -41,7 +41,7 @@ class ShutdownWindow : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ShutdownWindow(QWidget *parent=0, Qt::WindowFlags f=0);
|
explicit ShutdownWindow(QWidget *parent=0, Qt::WindowFlags f=0);
|
||||||
static QWidget *showShutdownWindow(BitcoinGUI *window);
|
static QWidget *showShutdownWindow(BitcoinGUI *window);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct CCoin {
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
CCoin() : nHeight(0) {}
|
CCoin() : nHeight(0) {}
|
||||||
CCoin(Coin&& in) : nHeight(in.nHeight), out(std::move(in.out)) {}
|
explicit CCoin(Coin&& in) : nHeight(in.nHeight), out(std::move(in.out)) {}
|
||||||
|
|
||||||
template <typename Stream, typename Operation>
|
template <typename Stream, typename Operation>
|
||||||
inline void SerializationOp(Stream& s, Operation ser_action)
|
inline void SerializationOp(Stream& s, Operation ser_action)
|
||||||
|
|
|
@ -17,7 +17,7 @@ class reverse_range
|
||||||
T &m_x;
|
T &m_x;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
reverse_range(T &x) : m_x(x) {}
|
explicit reverse_range(T &x) : m_x(x) {}
|
||||||
|
|
||||||
auto begin() const -> decltype(this->m_x.rbegin())
|
auto begin() const -> decltype(this->m_x.rbegin())
|
||||||
{
|
{
|
||||||
|
|
|
@ -686,7 +686,7 @@ public:
|
||||||
bool found;
|
bool found;
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
|
|
||||||
submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {}
|
explicit submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void BlockChecked(const CBlock& block, const CValidationState& stateIn) override {
|
void BlockChecked(const CBlock& block, const CValidationState& stateIn) override {
|
||||||
|
|
|
@ -125,7 +125,7 @@ class DescribeAddressVisitor : public boost::static_visitor<UniValue>
|
||||||
public:
|
public:
|
||||||
CWallet * const pwallet;
|
CWallet * const pwallet;
|
||||||
|
|
||||||
DescribeAddressVisitor(CWallet *_pwallet) : pwallet(_pwallet) {}
|
explicit DescribeAddressVisitor(CWallet *_pwallet) : pwallet(_pwallet) {}
|
||||||
|
|
||||||
UniValue operator()(const CNoDestination &dest) const { return UniValue(UniValue::VOBJ); }
|
UniValue operator()(const CNoDestination &dest) const { return UniValue(UniValue::VOBJ); }
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace RPCServer
|
||||||
/** Wrapper for UniValue::VType, which includes typeAny:
|
/** Wrapper for UniValue::VType, which includes typeAny:
|
||||||
* Used to denote don't care type. Only used by RPCTypeCheckObj */
|
* Used to denote don't care type. Only used by RPCTypeCheckObj */
|
||||||
struct UniValueType {
|
struct UniValueType {
|
||||||
UniValueType(UniValue::VType _type) : typeAny(false), type(_type) {}
|
explicit UniValueType(UniValue::VType _type) : typeAny(false), type(_type) {}
|
||||||
UniValueType() : typeAny(true) {}
|
UniValueType() : typeAny(true) {}
|
||||||
bool typeAny;
|
bool typeAny;
|
||||||
UniValue::VType type;
|
UniValue::VType type;
|
||||||
|
|
|
@ -174,7 +174,7 @@ void SingleThreadedSchedulerClient::ProcessQueue() {
|
||||||
// to ensure both happen safely even if callback() throws.
|
// to ensure both happen safely even if callback() throws.
|
||||||
struct RAIICallbacksRunning {
|
struct RAIICallbacksRunning {
|
||||||
SingleThreadedSchedulerClient* instance;
|
SingleThreadedSchedulerClient* instance;
|
||||||
RAIICallbacksRunning(SingleThreadedSchedulerClient* _instance) : instance(_instance) {}
|
explicit RAIICallbacksRunning(SingleThreadedSchedulerClient* _instance) : instance(_instance) {}
|
||||||
~RAIICallbacksRunning() {
|
~RAIICallbacksRunning() {
|
||||||
{
|
{
|
||||||
LOCK(instance->m_cs_callbacks_pending);
|
LOCK(instance->m_cs_callbacks_pending);
|
||||||
|
|
|
@ -102,7 +102,7 @@ private:
|
||||||
void ProcessQueue();
|
void ProcessQueue();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SingleThreadedSchedulerClient(CScheduler *pschedulerIn) : m_pscheduler(pschedulerIn) {}
|
explicit SingleThreadedSchedulerClient(CScheduler *pschedulerIn) : m_pscheduler(pschedulerIn) {}
|
||||||
void AddToProcessQueue(std::function<void (void)> func);
|
void AddToProcessQueue(std::function<void (void)> func);
|
||||||
|
|
||||||
// Processes all remaining queue members on the calling thread, blocking until queue is empty
|
// Processes all remaining queue members on the calling thread, blocking until queue is empty
|
||||||
|
|
|
@ -114,7 +114,7 @@ struct PrecomputedTransactionData
|
||||||
{
|
{
|
||||||
uint256 hashPrevouts, hashSequence, hashOutputs;
|
uint256 hashPrevouts, hashSequence, hashOutputs;
|
||||||
|
|
||||||
PrecomputedTransactionData(const CTransaction& tx);
|
explicit PrecomputedTransactionData(const CTransaction& tx);
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SigVersion
|
enum SigVersion
|
||||||
|
|
|
@ -21,7 +21,7 @@ protected:
|
||||||
const CKeyStore* keystore;
|
const CKeyStore* keystore;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BaseSignatureCreator(const CKeyStore* keystoreIn) : keystore(keystoreIn) {}
|
explicit BaseSignatureCreator(const CKeyStore* keystoreIn) : keystore(keystoreIn) {}
|
||||||
const CKeyStore& KeyStore() const { return *keystore; };
|
const CKeyStore& KeyStore() const { return *keystore; };
|
||||||
virtual ~BaseSignatureCreator() {}
|
virtual ~BaseSignatureCreator() {}
|
||||||
virtual const BaseSignatureChecker& Checker() const =0;
|
virtual const BaseSignatureChecker& Checker() const =0;
|
||||||
|
@ -54,7 +54,7 @@ public:
|
||||||
/** A signature creator that just produces 72-byte empty signatures. */
|
/** A signature creator that just produces 72-byte empty signatures. */
|
||||||
class DummySignatureCreator : public BaseSignatureCreator {
|
class DummySignatureCreator : public BaseSignatureCreator {
|
||||||
public:
|
public:
|
||||||
DummySignatureCreator(const CKeyStore* keystoreIn) : BaseSignatureCreator(keystoreIn) {}
|
explicit DummySignatureCreator(const CKeyStore* keystoreIn) : BaseSignatureCreator(keystoreIn) {}
|
||||||
const BaseSignatureChecker& Checker() const override;
|
const BaseSignatureChecker& Checker() const override;
|
||||||
bool CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const override;
|
bool CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -253,7 +253,7 @@ class CScriptVisitor : public boost::static_visitor<bool>
|
||||||
private:
|
private:
|
||||||
CScript *script;
|
CScript *script;
|
||||||
public:
|
public:
|
||||||
CScriptVisitor(CScript *scriptin) { script = scriptin; }
|
explicit CScriptVisitor(CScript *scriptin) { script = scriptin; }
|
||||||
|
|
||||||
bool operator()(const CNoDestination &dest) const {
|
bool operator()(const CNoDestination &dest) const {
|
||||||
script->clear();
|
script->clear();
|
||||||
|
|
|
@ -402,7 +402,7 @@ class CVarInt
|
||||||
protected:
|
protected:
|
||||||
I &n;
|
I &n;
|
||||||
public:
|
public:
|
||||||
CVarInt(I& nIn) : n(nIn) { }
|
explicit CVarInt(I& nIn) : n(nIn) { }
|
||||||
|
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
void Serialize(Stream &s) const {
|
void Serialize(Stream &s) const {
|
||||||
|
@ -420,7 +420,7 @@ class CCompactSize
|
||||||
protected:
|
protected:
|
||||||
uint64_t &n;
|
uint64_t &n;
|
||||||
public:
|
public:
|
||||||
CCompactSize(uint64_t& nIn) : n(nIn) { }
|
explicit CCompactSize(uint64_t& nIn) : n(nIn) { }
|
||||||
|
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
void Serialize(Stream &s) const {
|
void Serialize(Stream &s) const {
|
||||||
|
@ -439,7 +439,7 @@ class LimitedString
|
||||||
protected:
|
protected:
|
||||||
std::string& string;
|
std::string& string;
|
||||||
public:
|
public:
|
||||||
LimitedString(std::string& _string) : string(_string) {}
|
explicit LimitedString(std::string& _string) : string(_string) {}
|
||||||
|
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
void Unserialize(Stream& s)
|
void Unserialize(Stream& s)
|
||||||
|
|
|
@ -150,7 +150,7 @@ public:
|
||||||
* If this callback is provided and returns false, the allocation fails (hard fail), if
|
* If this callback is provided and returns false, the allocation fails (hard fail), if
|
||||||
* it returns true the allocation proceeds, but it could warn.
|
* it returns true the allocation proceeds, but it could warn.
|
||||||
*/
|
*/
|
||||||
LockedPool(std::unique_ptr<LockedPageAllocator> allocator, LockingFailed_Callback lf_cb_in = nullptr);
|
explicit LockedPool(std::unique_ptr<LockedPageAllocator> allocator, LockingFailed_Callback lf_cb_in = nullptr);
|
||||||
~LockedPool();
|
~LockedPool();
|
||||||
|
|
||||||
/** Allocate size bytes from this arena.
|
/** Allocate size bytes from this arena.
|
||||||
|
@ -217,7 +217,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LockedPoolManager(std::unique_ptr<LockedPageAllocator> allocator);
|
explicit LockedPoolManager(std::unique_ptr<LockedPageAllocator> allocator);
|
||||||
|
|
||||||
/** Create a new LockedPoolManager specialized to the OS */
|
/** Create a new LockedPoolManager specialized to the OS */
|
||||||
static void CreateInstance();
|
static void CreateInstance();
|
||||||
|
|
|
@ -196,7 +196,7 @@ private:
|
||||||
int value;
|
int value;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CSemaphore(int init) : value(init) {}
|
explicit CSemaphore(int init) : value(init) {}
|
||||||
|
|
||||||
void wait()
|
void wait()
|
||||||
{
|
{
|
||||||
|
@ -267,7 +267,7 @@ public:
|
||||||
|
|
||||||
CSemaphoreGrant() : sem(nullptr), fHaveGrant(false) {}
|
CSemaphoreGrant() : sem(nullptr), fHaveGrant(false) {}
|
||||||
|
|
||||||
CSemaphoreGrant(CSemaphore& sema, bool fTry = false) : sem(&sema), fHaveGrant(false)
|
explicit CSemaphoreGrant(CSemaphore& sema, bool fTry = false) : sem(&sema), fHaveGrant(false)
|
||||||
{
|
{
|
||||||
if (fTry)
|
if (fTry)
|
||||||
TryAcquire();
|
TryAcquire();
|
||||||
|
|
|
@ -78,7 +78,7 @@ class TestAddrTypeVisitor : public boost::static_visitor<bool>
|
||||||
private:
|
private:
|
||||||
std::string exp_addrType;
|
std::string exp_addrType;
|
||||||
public:
|
public:
|
||||||
TestAddrTypeVisitor(const std::string &_exp_addrType) : exp_addrType(_exp_addrType) { }
|
explicit TestAddrTypeVisitor(const std::string &_exp_addrType) : exp_addrType(_exp_addrType) { }
|
||||||
bool operator()(const CKeyID &id) const
|
bool operator()(const CKeyID &id) const
|
||||||
{
|
{
|
||||||
return (exp_addrType == "pubkey");
|
return (exp_addrType == "pubkey");
|
||||||
|
@ -99,7 +99,7 @@ class TestPayloadVisitor : public boost::static_visitor<bool>
|
||||||
private:
|
private:
|
||||||
std::vector<unsigned char> exp_payload;
|
std::vector<unsigned char> exp_payload;
|
||||||
public:
|
public:
|
||||||
TestPayloadVisitor(std::vector<unsigned char> &_exp_payload) : exp_payload(_exp_payload) { }
|
explicit TestPayloadVisitor(std::vector<unsigned char> &_exp_payload) : exp_payload(_exp_payload) { }
|
||||||
bool operator()(const CKeyID &id) const
|
bool operator()(const CKeyID &id) const
|
||||||
{
|
{
|
||||||
uint160 exp_key(exp_payload);
|
uint160 exp_key(exp_payload);
|
||||||
|
|
|
@ -24,7 +24,7 @@ struct TestVector {
|
||||||
std::string strHexMaster;
|
std::string strHexMaster;
|
||||||
std::vector<TestDerivation> vDerive;
|
std::vector<TestDerivation> vDerive;
|
||||||
|
|
||||||
TestVector(std::string strHexMasterIn) : strHexMaster(strHexMasterIn) {}
|
explicit TestVector(std::string strHexMasterIn) : strHexMaster(strHexMasterIn) {}
|
||||||
|
|
||||||
TestVector& operator()(std::string pub, std::string prv, unsigned int nChild) {
|
TestVector& operator()(std::string pub, std::string prv, unsigned int nChild) {
|
||||||
vDerive.push_back(TestDerivation());
|
vDerive.push_back(TestDerivation());
|
||||||
|
|
|
@ -118,12 +118,12 @@ public:
|
||||||
std::vector<uint64_t> shorttxids;
|
std::vector<uint64_t> shorttxids;
|
||||||
std::vector<PrefilledTransaction> prefilledtxn;
|
std::vector<PrefilledTransaction> prefilledtxn;
|
||||||
|
|
||||||
TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig) {
|
explicit TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig) {
|
||||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||||
stream << orig;
|
stream << orig;
|
||||||
stream >> *this;
|
stream >> *this;
|
||||||
}
|
}
|
||||||
TestHeaderAndShortIDs(const CBlock& block) :
|
explicit TestHeaderAndShortIDs(const CBlock& block) :
|
||||||
TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs(block, true)) {}
|
TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs(block, true)) {}
|
||||||
|
|
||||||
uint64_t GetShortID(const uint256& txhash) const {
|
uint64_t GetShortID(const uint256& txhash) const {
|
||||||
|
|
|
@ -74,7 +74,7 @@ public:
|
||||||
class CCoinsViewCacheTest : public CCoinsViewCache
|
class CCoinsViewCacheTest : public CCoinsViewCache
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CCoinsViewCacheTest(CCoinsView* _base) : CCoinsViewCache(_base) {}
|
explicit CCoinsViewCacheTest(CCoinsView* _base) : CCoinsViewCache(_base) {}
|
||||||
|
|
||||||
void SelfTest() const
|
void SelfTest() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -231,7 +231,7 @@ struct StringContentsSerializer {
|
||||||
// This is a terrible idea
|
// This is a terrible idea
|
||||||
std::string str;
|
std::string str;
|
||||||
StringContentsSerializer() {}
|
StringContentsSerializer() {}
|
||||||
StringContentsSerializer(const std::string& inp) : str(inp) {}
|
explicit StringContentsSerializer(const std::string& inp) : str(inp) {}
|
||||||
|
|
||||||
StringContentsSerializer& operator+=(const std::string& s) {
|
StringContentsSerializer& operator+=(const std::string& s) {
|
||||||
str += s;
|
str += s;
|
||||||
|
|
|
@ -41,7 +41,7 @@ static inline bool InsecureRandBool() { return insecure_rand_ctx.randbool(); }
|
||||||
struct BasicTestingSetup {
|
struct BasicTestingSetup {
|
||||||
ECCVerifyHandle globalVerifyHandle;
|
ECCVerifyHandle globalVerifyHandle;
|
||||||
|
|
||||||
BasicTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
explicit BasicTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
||||||
~BasicTestingSetup();
|
~BasicTestingSetup();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ struct TestingSetup: public BasicTestingSetup {
|
||||||
CConnman* connman;
|
CConnman* connman;
|
||||||
CScheduler scheduler;
|
CScheduler scheduler;
|
||||||
|
|
||||||
TestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
explicit TestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
||||||
~TestingSetup();
|
~TestingSetup();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ namespace tinyformat {
|
||||||
class format_error: public std::runtime_error
|
class format_error: public std::runtime_error
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
format_error(const std::string &what): std::runtime_error(what) {
|
explicit format_error(const std::string &what): std::runtime_error(what) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ class FormatArg
|
||||||
FormatArg() {}
|
FormatArg() {}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
FormatArg(const T& value)
|
explicit FormatArg(const T& value)
|
||||||
: m_value(static_cast<const void*>(&value)),
|
: m_value(static_cast<const void*>(&value)),
|
||||||
m_formatImpl(&formatImpl<T>),
|
m_formatImpl(&formatImpl<T>),
|
||||||
m_toIntImpl(&toIntImpl<T>)
|
m_toIntImpl(&toIntImpl<T>)
|
||||||
|
@ -867,7 +867,7 @@ class FormatListN : public FormatList
|
||||||
public:
|
public:
|
||||||
#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES
|
#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
FormatListN(const Args&... args)
|
explicit FormatListN(const Args&... args)
|
||||||
: FormatList(&m_formatterStore[0], N),
|
: FormatList(&m_formatterStore[0], N),
|
||||||
m_formatterStore { FormatArg(args)... }
|
m_formatterStore { FormatArg(args)... }
|
||||||
{ static_assert(sizeof...(args) == N, "Number of args must be N"); }
|
{ static_assert(sizeof...(args) == N, "Number of args must be N"); }
|
||||||
|
@ -876,7 +876,7 @@ class FormatListN : public FormatList
|
||||||
# define TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR(n) \
|
# define TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR(n) \
|
||||||
\
|
\
|
||||||
template<TINYFORMAT_ARGTYPES(n)> \
|
template<TINYFORMAT_ARGTYPES(n)> \
|
||||||
FormatListN(TINYFORMAT_VARARGS(n)) \
|
explicit FormatListN(TINYFORMAT_VARARGS(n)) \
|
||||||
: FormatList(&m_formatterStore[0], n) \
|
: FormatList(&m_formatterStore[0], n) \
|
||||||
{ assert(n == N); init(0, TINYFORMAT_PASSARGS(n)); } \
|
{ assert(n == N); init(0, TINYFORMAT_PASSARGS(n)); } \
|
||||||
\
|
\
|
||||||
|
|
|
@ -76,7 +76,7 @@ public:
|
||||||
|
|
||||||
/** Create a new TorControlConnection.
|
/** Create a new TorControlConnection.
|
||||||
*/
|
*/
|
||||||
TorControlConnection(struct event_base *base);
|
explicit TorControlConnection(struct event_base *base);
|
||||||
~TorControlConnection();
|
~TorControlConnection();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace {
|
||||||
struct CoinEntry {
|
struct CoinEntry {
|
||||||
COutPoint* outpoint;
|
COutPoint* outpoint;
|
||||||
char key;
|
char key;
|
||||||
CoinEntry(const COutPoint* ptr) : outpoint(const_cast<COutPoint*>(ptr)), key(DB_COIN) {}
|
explicit CoinEntry(const COutPoint* ptr) : outpoint(const_cast<COutPoint*>(ptr)), key(DB_COIN) {}
|
||||||
|
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
void Serialize(Stream &s) const {
|
void Serialize(Stream &s) const {
|
||||||
|
|
|
@ -69,7 +69,7 @@ class CCoinsViewDB : public CCoinsView
|
||||||
protected:
|
protected:
|
||||||
CDBWrapper db;
|
CDBWrapper db;
|
||||||
public:
|
public:
|
||||||
CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);
|
explicit CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);
|
||||||
|
|
||||||
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;
|
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;
|
||||||
bool HaveCoin(const COutPoint &outpoint) const override;
|
bool HaveCoin(const COutPoint &outpoint) const override;
|
||||||
|
@ -109,7 +109,7 @@ private:
|
||||||
class CBlockTreeDB : public CDBWrapper
|
class CBlockTreeDB : public CDBWrapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CBlockTreeDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);
|
explicit CBlockTreeDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);
|
||||||
private:
|
private:
|
||||||
CBlockTreeDB(const CBlockTreeDB&);
|
CBlockTreeDB(const CBlockTreeDB&);
|
||||||
void operator=(const CBlockTreeDB&);
|
void operator=(const CBlockTreeDB&);
|
||||||
|
|
|
@ -167,7 +167,7 @@ struct update_ancestor_state
|
||||||
|
|
||||||
struct update_fee_delta
|
struct update_fee_delta
|
||||||
{
|
{
|
||||||
update_fee_delta(int64_t _feeDelta) : feeDelta(_feeDelta) { }
|
explicit update_fee_delta(int64_t _feeDelta) : feeDelta(_feeDelta) { }
|
||||||
|
|
||||||
void operator() (CTxMemPoolEntry &e) { e.UpdateFeeDelta(feeDelta); }
|
void operator() (CTxMemPoolEntry &e) { e.UpdateFeeDelta(feeDelta); }
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ private:
|
||||||
|
|
||||||
struct update_lock_points
|
struct update_lock_points
|
||||||
{
|
{
|
||||||
update_lock_points(const LockPoints& _lp) : lp(_lp) { }
|
explicit update_lock_points(const LockPoints& _lp) : lp(_lp) { }
|
||||||
|
|
||||||
void operator() (CTxMemPoolEntry &e) { e.UpdateLockPoints(lp); }
|
void operator() (CTxMemPoolEntry &e) { e.UpdateLockPoints(lp); }
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ public:
|
||||||
|
|
||||||
/** Create a new CTxMemPool.
|
/** Create a new CTxMemPool.
|
||||||
*/
|
*/
|
||||||
CTxMemPool(CBlockPolicyEstimator* estimator = nullptr);
|
explicit CTxMemPool(CBlockPolicyEstimator* estimator = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If sanity-checking is turned on, check makes sure the pool is
|
* If sanity-checking is turned on, check makes sure the pool is
|
||||||
|
|
|
@ -111,7 +111,7 @@ public:
|
||||||
class uint160 : public base_blob<160> {
|
class uint160 : public base_blob<160> {
|
||||||
public:
|
public:
|
||||||
uint160() {}
|
uint160() {}
|
||||||
uint160(const base_blob<160>& b) : base_blob<160>(b) {}
|
explicit uint160(const base_blob<160>& b) : base_blob<160>(b) {}
|
||||||
explicit uint160(const std::vector<unsigned char>& vch) : base_blob<160>(vch) {}
|
explicit uint160(const std::vector<unsigned char>& vch) : base_blob<160>(vch) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ public:
|
||||||
class uint256 : public base_blob<256> {
|
class uint256 : public base_blob<256> {
|
||||||
public:
|
public:
|
||||||
uint256() {}
|
uint256() {}
|
||||||
uint256(const base_blob<256>& b) : base_blob<256>(b) {}
|
explicit uint256(const base_blob<256>& b) : base_blob<256>(b) {}
|
||||||
explicit uint256(const std::vector<unsigned char>& vch) : base_blob<256>(vch) {}
|
explicit uint256(const std::vector<unsigned char>& vch) : base_blob<256>(vch) {}
|
||||||
|
|
||||||
/** A cheap hash function that just returns 64 bits from the result, it can be
|
/** A cheap hash function that just returns 64 bits from the result, it can be
|
||||||
|
|
|
@ -33,7 +33,7 @@ public:
|
||||||
::Serialize(s, CTxOutCompressor(REF(txout->out)));
|
::Serialize(s, CTxOutCompressor(REF(txout->out)));
|
||||||
}
|
}
|
||||||
|
|
||||||
TxInUndoSerializer(const Coin* coin) : txout(coin) {}
|
explicit TxInUndoSerializer(const Coin* coin) : txout(coin) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class TxInUndoDeserializer
|
class TxInUndoDeserializer
|
||||||
|
@ -57,7 +57,7 @@ public:
|
||||||
::Unserialize(s, REF(CTxOutCompressor(REF(txout->out))));
|
::Unserialize(s, REF(CTxOutCompressor(REF(txout->out))));
|
||||||
}
|
}
|
||||||
|
|
||||||
TxInUndoDeserializer(Coin* coin) : txout(coin) {}
|
explicit TxInUndoDeserializer(Coin* coin) : txout(coin) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const size_t MIN_TRANSACTION_INPUT_WEIGHT = WITNESS_SCALE_FACTOR * ::GetSerializeSize(CTxIn(), SER_NETWORK, PROTOCOL_VERSION);
|
static const size_t MIN_TRANSACTION_INPUT_WEIGHT = WITNESS_SCALE_FACTOR * ::GetSerializeSize(CTxIn(), SER_NETWORK, PROTOCOL_VERSION);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
class JSONUTF8StringFilter
|
class JSONUTF8StringFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JSONUTF8StringFilter(std::string &s):
|
explicit JSONUTF8StringFilter(std::string &s):
|
||||||
str(s), is_valid(true), codepoint(0), state(0), surpair(0)
|
str(s), is_valid(true), codepoint(0), state(0), surpair(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -1563,7 +1563,7 @@ private:
|
||||||
int bit;
|
int bit;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WarningBitsConditionChecker(int bitIn) : bit(bitIn) {}
|
explicit WarningBitsConditionChecker(int bitIn) : bit(bitIn) {}
|
||||||
|
|
||||||
int64_t BeginTime(const Consensus::Params& params) const override { return 0; }
|
int64_t BeginTime(const Consensus::Params& params) const override { return 0; }
|
||||||
int64_t EndTime(const Consensus::Params& params) const override { return std::numeric_limits<int64_t>::max(); }
|
int64_t EndTime(const Consensus::Params& params) const override { return std::numeric_limits<int64_t>::max(); }
|
||||||
|
@ -2135,7 +2135,7 @@ private:
|
||||||
CTxMemPool &pool;
|
CTxMemPool &pool;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConnectTrace(CTxMemPool &_pool) : blocksConnected(1), pool(_pool) {
|
explicit ConnectTrace(CTxMemPool &_pool) : blocksConnected(1), pool(_pool) {
|
||||||
pool.NotifyEntryRemoved.connect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));
|
pool.NotifyEntryRemoved.connect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ struct MainSignalsInstance {
|
||||||
// our own queue here :(
|
// our own queue here :(
|
||||||
SingleThreadedSchedulerClient m_schedulerClient;
|
SingleThreadedSchedulerClient m_schedulerClient;
|
||||||
|
|
||||||
MainSignalsInstance(CScheduler *pscheduler) : m_schedulerClient(pscheduler) {}
|
explicit MainSignalsInstance(CScheduler *pscheduler) : m_schedulerClient(pscheduler) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
static CMainSignals g_signals;
|
static CMainSignals g_signals;
|
||||||
|
|
|
@ -185,7 +185,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VersionBitsConditionChecker(Consensus::DeploymentPos id_) : id(id_) {}
|
explicit VersionBitsConditionChecker(Consensus::DeploymentPos id_) : id(id_) {}
|
||||||
uint32_t Mask(const Consensus::Params& params) const { return ((uint32_t)1) << params.vDeployments[id].bit; }
|
uint32_t Mask(const Consensus::Params& params) const { return ((uint32_t)1) << params.vDeployments[id].bit; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1123,7 +1123,7 @@ public:
|
||||||
CWallet * const pwallet;
|
CWallet * const pwallet;
|
||||||
CScriptID result;
|
CScriptID result;
|
||||||
|
|
||||||
Witnessifier(CWallet *_pwallet) : pwallet(_pwallet) {}
|
explicit Witnessifier(CWallet *_pwallet) : pwallet(_pwallet) {}
|
||||||
|
|
||||||
bool operator()(const CNoDestination &dest) const { return false; }
|
bool operator()(const CNoDestination &dest) const { return false; }
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
/** Testing setup and teardown for wallet.
|
/** Testing setup and teardown for wallet.
|
||||||
*/
|
*/
|
||||||
struct WalletTestingSetup: public TestingSetup {
|
struct WalletTestingSetup: public TestingSetup {
|
||||||
WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
||||||
~WalletTestingSetup();
|
~WalletTestingSetup();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ public:
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
CMerkleTx(CTransactionRef arg)
|
explicit CMerkleTx(CTransactionRef arg)
|
||||||
{
|
{
|
||||||
SetTx(std::move(arg));
|
SetTx(std::move(arg));
|
||||||
Init();
|
Init();
|
||||||
|
@ -548,7 +548,7 @@ public:
|
||||||
//! todo: add something to note what created it (user, getnewaddress, change)
|
//! todo: add something to note what created it (user, getnewaddress, change)
|
||||||
//! maybe should have a map<string, string> property map
|
//! maybe should have a map<string, string> property map
|
||||||
|
|
||||||
CWalletKey(int64_t nExpires=0);
|
explicit CWalletKey(int64_t nExpires=0);
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
|
@ -765,7 +765,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create wallet with passed-in database handle
|
// Create wallet with passed-in database handle
|
||||||
CWallet(std::unique_ptr<CWalletDBWrapper> dbw_in) : dbw(std::move(dbw_in))
|
explicit CWallet(std::unique_ptr<CWalletDBWrapper> dbw_in) : dbw(std::move(dbw_in))
|
||||||
{
|
{
|
||||||
SetNull();
|
SetNull();
|
||||||
}
|
}
|
||||||
|
@ -1145,7 +1145,7 @@ protected:
|
||||||
CPubKey vchPubKey;
|
CPubKey vchPubKey;
|
||||||
bool fInternal;
|
bool fInternal;
|
||||||
public:
|
public:
|
||||||
CReserveKey(CWallet* pwalletIn)
|
explicit CReserveKey(CWallet* pwalletIn)
|
||||||
{
|
{
|
||||||
nIndex = -1;
|
nIndex = -1;
|
||||||
pwallet = pwalletIn;
|
pwallet = pwalletIn;
|
||||||
|
|
|
@ -105,7 +105,7 @@ public:
|
||||||
{
|
{
|
||||||
SetNull();
|
SetNull();
|
||||||
}
|
}
|
||||||
CKeyMetadata(int64_t nCreateTime_)
|
explicit CKeyMetadata(int64_t nCreateTime_)
|
||||||
{
|
{
|
||||||
SetNull();
|
SetNull();
|
||||||
nCreateTime = nCreateTime_;
|
nCreateTime = nCreateTime_;
|
||||||
|
@ -162,7 +162,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CWalletDB(CWalletDBWrapper& dbw, const char* pszMode = "r+", bool _fFlushOnClose = true) :
|
explicit CWalletDB(CWalletDBWrapper& dbw, const char* pszMode = "r+", bool _fFlushOnClose = true) :
|
||||||
batch(dbw, pszMode, _fFlushOnClose),
|
batch(dbw, pszMode, _fFlushOnClose),
|
||||||
m_dbw(dbw)
|
m_dbw(dbw)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue