mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Declare single-argument (non-converting) constructors "explicit"
In order to avoid unintended implicit conversions.
This commit is contained in:
@@ -118,12 +118,12 @@ public:
|
||||
std::vector<uint64_t> shorttxids;
|
||||
std::vector<PrefilledTransaction> prefilledtxn;
|
||||
|
||||
TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig) {
|
||||
explicit TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig) {
|
||||
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
stream << orig;
|
||||
stream >> *this;
|
||||
}
|
||||
TestHeaderAndShortIDs(const CBlock& block) :
|
||||
explicit TestHeaderAndShortIDs(const CBlock& block) :
|
||||
TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs(block, true)) {}
|
||||
|
||||
uint64_t GetShortID(const uint256& txhash) const {
|
||||
|
||||
Reference in New Issue
Block a user