0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

tidy: modernize-use-equals-default

This commit is contained in:
MarcoFalke 2024-07-08 11:11:58 +02:00
parent bd5d1688b4
commit 3333bae9b2
No known key found for this signature in database
53 changed files with 72 additions and 76 deletions

View file

@ -10,6 +10,7 @@ misc-unused-using-decls,
misc-no-recursion, misc-no-recursion,
modernize-use-default-member-init, modernize-use-default-member-init,
modernize-use-emplace, modernize-use-emplace,
modernize-use-equals-default,
modernize-use-noexcept, modernize-use-noexcept,
modernize-use-nullptr, modernize-use-nullptr,
performance-*, performance-*,

View file

@ -240,7 +240,7 @@ public:
/** 256-bit unsigned big integer. */ /** 256-bit unsigned big integer. */
class arith_uint256 : public base_uint<256> { class arith_uint256 : public base_uint<256> {
public: public:
arith_uint256() {} arith_uint256() = default;
arith_uint256(const base_uint<256>& b) : base_uint<256>(b) {} arith_uint256(const base_uint<256>& b) : base_uint<256>(b) {}
arith_uint256(uint64_t b) : base_uint<256>(b) {} arith_uint256(uint64_t b) : base_uint<256>(b) {}

View file

@ -59,7 +59,7 @@ public:
uint256 blockhash; uint256 blockhash;
std::vector<CTransactionRef> txn; std::vector<CTransactionRef> txn;
BlockTransactions() {} BlockTransactions() = default;
explicit BlockTransactions(const BlockTransactionsRequest& req) : explicit BlockTransactions(const BlockTransactionsRequest& req) :
blockhash(req.blockhash), txn(req.indexes.size()) {} blockhash(req.blockhash), txn(req.indexes.size()) {}
@ -109,7 +109,7 @@ public:
/** /**
* Dummy for deserialization * Dummy for deserialization
*/ */
CBlockHeaderAndShortTxIDs() {} CBlockHeaderAndShortTxIDs() = default;
/** /**
* @param[in] nonce This should be randomly generated, and is used for the siphash secret key * @param[in] nonce This should be randomly generated, and is used for the siphash secret key

View file

@ -66,7 +66,7 @@ public:
READWRITE(VARINT(obj.nTimeLast)); READWRITE(VARINT(obj.nTimeLast));
} }
CBlockFileInfo() {} CBlockFileInfo() = default;
std::string ToString() const; std::string ToString() const;

View file

@ -154,7 +154,7 @@ class CCoinsViewCursor
{ {
public: public:
CCoinsViewCursor(const uint256 &hashBlockIn): hashBlock(hashBlockIn) {} CCoinsViewCursor(const uint256 &hashBlockIn): hashBlock(hashBlockIn) {}
virtual ~CCoinsViewCursor() {} virtual ~CCoinsViewCursor() = default;
virtual bool GetKey(COutPoint &key) const = 0; virtual bool GetKey(COutPoint &key) const = 0;
virtual bool GetValue(Coin &coin) const = 0; virtual bool GetValue(Coin &coin) const = 0;
@ -198,7 +198,7 @@ public:
virtual std::unique_ptr<CCoinsViewCursor> Cursor() const; virtual std::unique_ptr<CCoinsViewCursor> Cursor() const;
//! As we use CCoinsViews polymorphically, have a virtual destructor //! As we use CCoinsViews polymorphically, have a virtual destructor
virtual ~CCoinsView() {} virtual ~CCoinsView() = default;
//! Estimate database size (0 if not implemented) //! Estimate database size (0 if not implemented)
virtual size_t EstimateSize() const { return 0; } virtual size_t EstimateSize() const { return 0; }

View file

@ -97,7 +97,7 @@ private:
public: public:
/* The empty set. */ /* The empty set. */
MuHash3072() noexcept {}; MuHash3072() noexcept = default;
/* A singleton with variable sized data in it. */ /* A singleton with variable sized data in it. */
explicit MuHash3072(Span<const unsigned char> in) noexcept; explicit MuHash3072(Span<const unsigned char> in) noexcept;

View file

@ -32,7 +32,7 @@ private:
public: public:
static constexpr size_t OUTPUT_SIZE = 32; static constexpr size_t OUTPUT_SIZE = 32;
SHA3_256() {} SHA3_256() = default;
SHA3_256& Write(Span<const unsigned char> data); SHA3_256& Write(Span<const unsigned char> data);
SHA3_256& Finalize(Span<unsigned char> output); SHA3_256& Finalize(Span<unsigned char> output);
SHA3_256& Reset(); SHA3_256& Reset();

View file

@ -18,7 +18,7 @@ struct FlatFilePos
SERIALIZE_METHODS(FlatFilePos, obj) { READWRITE(VARINT_MODE(obj.nFile, VarIntMode::NONNEGATIVE_SIGNED), VARINT(obj.nPos)); } SERIALIZE_METHODS(FlatFilePos, obj) { READWRITE(VARINT_MODE(obj.nFile, VarIntMode::NONNEGATIVE_SIGNED), VARINT(obj.nPos)); }
FlatFilePos() {} FlatFilePos() = default;
FlatFilePos(int nFileIn, unsigned int nPosIn) : FlatFilePos(int nFileIn, unsigned int nPosIn) :
nFile(nFileIn), nFile(nFileIn),

View file

@ -100,7 +100,7 @@ struct CompressedHeader {
class HeadersSyncState { class HeadersSyncState {
public: public:
~HeadersSyncState() {} ~HeadersSyncState() = default;
enum class State { enum class State {
/** PRESYNC means the peer has not yet demonstrated their chain has /** PRESYNC means the peer has not yet demonstrated their chain has

View file

@ -156,7 +156,7 @@ class HTTPClosure
{ {
public: public:
virtual void operator()() = 0; virtual void operator()() = 0;
virtual ~HTTPClosure() {} virtual ~HTTPClosure() = default;
}; };
/** Event class. This can be used either as a cross-thread trigger or as a timer. /** Event class. This can be used either as a cross-thread trigger or as a timer.

View file

@ -20,7 +20,7 @@ struct CDiskTxPos : public FlatFilePos
CDiskTxPos(const FlatFilePos &blockIn, unsigned int nTxOffsetIn) : FlatFilePos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) { CDiskTxPos(const FlatFilePos &blockIn, unsigned int nTxOffsetIn) : FlatFilePos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
} }
CDiskTxPos() {} CDiskTxPos() = default;
}; };
#endif // BITCOIN_INDEX_DISKTXPOS_H #endif // BITCOIN_INDEX_DISKTXPOS_H

View file

@ -123,7 +123,7 @@ struct BlockInfo {
class Chain class Chain
{ {
public: public:
virtual ~Chain() {} virtual ~Chain() = default;
//! Get current chain height, not including genesis block (returns 0 if //! Get current chain height, not including genesis block (returns 0 if
//! chain only contains genesis block, nullopt if chain does not contain //! chain only contains genesis block, nullopt if chain does not contain
@ -309,7 +309,7 @@ public:
class Notifications class Notifications
{ {
public: public:
virtual ~Notifications() {} virtual ~Notifications() = default;
virtual void transactionAddedToMempool(const CTransactionRef& tx) {} virtual void transactionAddedToMempool(const CTransactionRef& tx) {}
virtual void transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason) {} virtual void transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason) {}
virtual void blockConnected(ChainstateRole role, const BlockInfo& block) {} virtual void blockConnected(ChainstateRole role, const BlockInfo& block) {}
@ -371,7 +371,7 @@ public:
class ChainClient class ChainClient
{ {
public: public:
virtual ~ChainClient() {} virtual ~ChainClient() = default;
//! Register rpcs. //! Register rpcs.
virtual void registerRpcs() = 0; virtual void registerRpcs() = 0;

View file

@ -13,7 +13,7 @@ namespace interfaces {
class Echo class Echo
{ {
public: public:
virtual ~Echo() {} virtual ~Echo() = default;
//! Echo provided string. //! Echo provided string.
virtual std::string echo(const std::string& echo) = 0; virtual std::string echo(const std::string& echo) = 0;

View file

@ -22,7 +22,7 @@ namespace interfaces {
class Handler class Handler
{ {
public: public:
virtual ~Handler() {} virtual ~Handler() = default;
//! Disconnect the handler. //! Disconnect the handler.
virtual void disconnect() = 0; virtual void disconnect() = 0;

View file

@ -26,7 +26,7 @@ namespace interfaces {
class Mining class Mining
{ {
public: public:
virtual ~Mining() {} virtual ~Mining() = default;
//! If this chain is exclusively used for testing //! If this chain is exclusively used for testing
virtual bool isTestChain() = 0; virtual bool isTestChain() = 0;

View file

@ -59,7 +59,7 @@ struct BlockAndHeaderTipInfo
class ExternalSigner class ExternalSigner
{ {
public: public:
virtual ~ExternalSigner() {}; virtual ~ExternalSigner() = default;
//! Get signer display name //! Get signer display name
virtual std::string getName() = 0; virtual std::string getName() = 0;
@ -69,7 +69,7 @@ public:
class Node class Node
{ {
public: public:
virtual ~Node() {} virtual ~Node() = default;
//! Init logging. //! Init logging.
virtual void initLogging() = 0; virtual void initLogging() = 0;

View file

@ -65,7 +65,7 @@ using WalletValueMap = std::map<std::string, std::string>;
class Wallet class Wallet
{ {
public: public:
virtual ~Wallet() {} virtual ~Wallet() = default;
//! Encrypt wallet. //! Encrypt wallet.
virtual bool encryptWallet(const SecureString& wallet_passphrase) = 0; virtual bool encryptWallet(const SecureString& wallet_passphrase) = 0;

View file

@ -163,7 +163,7 @@ public:
static std::unique_ptr<const CChainParams> TestNet(); static std::unique_ptr<const CChainParams> TestNet();
protected: protected:
CChainParams() {} CChainParams() = default;
Consensus::Params consensus; Consensus::Params consensus;
MessageStartChars pchMessageStart; MessageStartChars pchMessageStart;

View file

@ -35,7 +35,7 @@ bool IsInterrupted(const T& result)
class Notifications class Notifications
{ {
public: public:
virtual ~Notifications(){}; virtual ~Notifications() = default;
[[nodiscard]] virtual InterruptResult blockTip(SynchronizationState state, CBlockIndex& index) { return {}; } [[nodiscard]] virtual InterruptResult blockTip(SynchronizationState state, CBlockIndex& index) { return {}; }
virtual void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) {} virtual void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) {}

View file

@ -147,7 +147,7 @@ public:
// Create from a CBlock, matching the txids in the set // Create from a CBlock, matching the txids in the set
CMerkleBlock(const CBlock& block, const std::set<Txid>& txids) : CMerkleBlock{block, nullptr, &txids} {} CMerkleBlock(const CBlock& block, const std::set<Txid>& txids) : CMerkleBlock{block, nullptr, &txids} {}
CMerkleBlock() {} CMerkleBlock() = default;
SERIALIZE_METHODS(CMerkleBlock, obj) { READWRITE(obj.header, obj.txn); } SERIALIZE_METHODS(CMerkleBlock, obj) { READWRITE(obj.header, obj.txn); }

View file

@ -250,7 +250,7 @@ public:
/** The Transport converts one connection's sent messages to wire bytes, and received bytes back. */ /** The Transport converts one connection's sent messages to wire bytes, and received bytes back. */
class Transport { class Transport {
public: public:
virtual ~Transport() {} virtual ~Transport() = default;
struct Info struct Info
{ {

View file

@ -76,7 +76,7 @@ public:
static std::unique_ptr<PeerManager> make(CConnman& connman, AddrMan& addrman, static std::unique_ptr<PeerManager> make(CConnman& connman, AddrMan& addrman,
BanMan* banman, ChainstateManager& chainman, BanMan* banman, ChainstateManager& chainman,
CTxMemPool& pool, node::Warnings& warnings, Options opts); CTxMemPool& pool, node::Warnings& warnings, Options opts);
virtual ~PeerManager() { } virtual ~PeerManager() = default;
/** /**
* Attempt to manually fetch block from a given peer. We must already have the header. * Attempt to manually fetch block from a given peer. We must already have the header.

View file

@ -19,7 +19,7 @@ public:
int64_t nCreateTime{0}; int64_t nCreateTime{0};
int64_t nBanUntil{0}; int64_t nBanUntil{0};
CBanEntry() {} CBanEntry() = default;
explicit CBanEntry(int64_t nCreateTimeIn) explicit CBanEntry(int64_t nCreateTimeIn)
: nCreateTime{nCreateTimeIn} {} : nCreateTime{nCreateTimeIn} {}

View file

@ -283,7 +283,7 @@ private:
{ {
unsigned int blockHeight{0}; unsigned int blockHeight{0};
unsigned int bucketIndex{0}; unsigned int bucketIndex{0};
TxStatsInfo() {} TxStatsInfo() = default;
}; };
// map of txids to information about that transaction // map of txids to information about that transaction

View file

@ -242,7 +242,7 @@ public:
fill(item_ptr(0), first, last); fill(item_ptr(0), first, last);
} }
prevector() {} prevector() = default;
explicit prevector(size_type n) { explicit prevector(size_type n) {
resize(n); resize(n);

View file

@ -133,7 +133,7 @@ struct CBlockLocator
std::vector<uint256> vHave; std::vector<uint256> vHave;
CBlockLocator() {} CBlockLocator() = default;
explicit CBlockLocator(std::vector<uint256>&& have) : vHave(std::move(have)) {} explicit CBlockLocator(std::vector<uint256>&& have) : vHave(std::move(have)) {}

View file

@ -225,7 +225,7 @@ struct PSBTInput
void FillSignatureData(SignatureData& sigdata) const; void FillSignatureData(SignatureData& sigdata) const;
void FromSignatureData(const SignatureData& sigdata); void FromSignatureData(const SignatureData& sigdata);
void Merge(const PSBTInput& input); void Merge(const PSBTInput& input);
PSBTInput() {} PSBTInput() = default;
template <typename Stream> template <typename Stream>
inline void Serialize(Stream& s) const { inline void Serialize(Stream& s) const {
@ -726,7 +726,7 @@ struct PSBTOutput
void FillSignatureData(SignatureData& sigdata) const; void FillSignatureData(SignatureData& sigdata) const;
void FromSignatureData(const SignatureData& sigdata); void FromSignatureData(const SignatureData& sigdata);
void Merge(const PSBTOutput& output); void Merge(const PSBTOutput& output);
PSBTOutput() {} PSBTOutput() = default;
template <typename Stream> template <typename Stream>
inline void Serialize(Stream& s) const { inline void Serialize(Stream& s) const {
@ -967,7 +967,7 @@ struct PartiallySignedTransaction
[[nodiscard]] bool Merge(const PartiallySignedTransaction& psbt); [[nodiscard]] bool Merge(const PartiallySignedTransaction& psbt);
bool AddInput(const CTxIn& txin, PSBTInput& psbtin); bool AddInput(const CTxIn& txin, PSBTInput& psbtin);
bool AddOutput(const CTxOut& txout, const PSBTOutput& psbtout); bool AddOutput(const CTxOut& txout, const PSBTOutput& psbtout);
PartiallySignedTransaction() {} PartiallySignedTransaction() = default;
explicit PartiallySignedTransaction(const CMutableTransaction& tx); explicit PartiallySignedTransaction(const CMutableTransaction& tx);
/** /**
* Finds the UTXO for a given input index * Finds the UTXO for a given input index

View file

@ -29,7 +29,7 @@ public:
static QString toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord* rec, BitcoinUnit unit); static QString toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord* rec, BitcoinUnit unit);
private: private:
TransactionDesc() {} TransactionDesc() = default;
static QString FormatTxStatus(const interfaces::WalletTxStatus& status, bool inMempool); static QString FormatTxStatus(const interfaces::WalletTxStatus& status, bool inMempool);
}; };

View file

@ -48,7 +48,7 @@ bool RPCIsInWarmup(std::string *outStatus);
class RPCTimerBase class RPCTimerBase
{ {
public: public:
virtual ~RPCTimerBase() {} virtual ~RPCTimerBase() = default;
}; };
/** /**
@ -57,7 +57,7 @@ public:
class RPCTimerInterface class RPCTimerInterface
{ {
public: public:
virtual ~RPCTimerInterface() {} virtual ~RPCTimerInterface() = default;
/** Implementation name */ /** Implementation name */
virtual const char *Name() = 0; virtual const char *Name() = 0;
/** Factory function for timers. /** Factory function for timers.

View file

@ -265,7 +265,7 @@ public:
return false; return false;
} }
virtual ~BaseSignatureChecker() {} virtual ~BaseSignatureChecker() = default;
}; };
/** Enum to specify what *TransactionSignatureChecker's behavior should be /** Enum to specify what *TransactionSignatureChecker's behavior should be

View file

@ -305,7 +305,7 @@ struct InputStack {
//! Data elements. //! Data elements.
std::vector<std::vector<unsigned char>> stack; std::vector<std::vector<unsigned char>> stack;
//! Construct an empty stack (valid). //! Construct an empty stack (valid).
InputStack() {} InputStack() = default;
//! Construct a valid single-element stack (with an element up to 75 bytes). //! Construct a valid single-element stack (with an element up to 75 bytes).
InputStack(std::vector<unsigned char> in) : size(in.size() + 1), stack(Vector(std::move(in))) {} InputStack(std::vector<unsigned char> in) : size(in.size() + 1), stack(Vector(std::move(in))) {}
//! Change availability //! Change availability

View file

@ -430,7 +430,7 @@ protected:
return *this; return *this;
} }
public: public:
CScript() { } CScript() = default;
CScript(const_iterator pbegin, const_iterator pend) : CScriptBase(pbegin, pend) { } CScript(const_iterator pbegin, const_iterator pend) : CScriptBase(pbegin, pend) { }
CScript(std::vector<unsigned char>::const_iterator pbegin, std::vector<unsigned char>::const_iterator pend) : CScriptBase(pbegin, pend) { } CScript(std::vector<unsigned char>::const_iterator pbegin, std::vector<unsigned char>::const_iterator pend) : CScriptBase(pbegin, pend) { }
CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { } CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { }
@ -569,7 +569,7 @@ struct CScriptWitness
std::vector<std::vector<unsigned char> > stack; std::vector<std::vector<unsigned char> > stack;
// Some compilers complain without a default constructor // Some compilers complain without a default constructor
CScriptWitness() { } CScriptWitness() = default;
bool IsNull() const { return stack.empty(); } bool IsNull() const { return stack.empty(); }

View file

@ -27,7 +27,7 @@ struct CMutableTransaction;
/** Interface for signature creators. */ /** Interface for signature creators. */
class BaseSignatureCreator { class BaseSignatureCreator {
public: public:
virtual ~BaseSignatureCreator() {} virtual ~BaseSignatureCreator() = default;
virtual const BaseSignatureChecker& Checker() const =0; virtual const BaseSignatureChecker& Checker() const =0;
/** Create a singular (non-script) signature. */ /** Create a singular (non-script) signature. */
@ -89,7 +89,7 @@ struct SignatureData {
std::map<std::vector<uint8_t>, std::vector<uint8_t>> ripemd160_preimages; ///< Mapping from a RIPEMD160 hash to its preimage provided to solve a Script std::map<std::vector<uint8_t>, std::vector<uint8_t>> ripemd160_preimages; ///< Mapping from a RIPEMD160 hash to its preimage provided to solve a Script
std::map<std::vector<uint8_t>, std::vector<uint8_t>> hash160_preimages; ///< Mapping from a HASH160 hash to its preimage provided to solve a Script std::map<std::vector<uint8_t>, std::vector<uint8_t>> hash160_preimages; ///< Mapping from a HASH160 hash to its preimage provided to solve a Script
SignatureData() {} SignatureData() = default;
explicit SignatureData(const CScript& script) : scriptSig(script) {} explicit SignatureData(const CScript& script) : scriptSig(script) {}
void MergeSignatureData(SignatureData sigdata); void MergeSignatureData(SignatureData sigdata);
}; };

View file

@ -150,7 +150,7 @@ std::optional<std::vector<std::tuple<int, std::vector<unsigned char>, int>>> Inf
class SigningProvider class SigningProvider
{ {
public: public:
virtual ~SigningProvider() {} virtual ~SigningProvider() = default;
virtual bool GetCScript(const CScriptID &scriptid, CScript& script) const { return false; } virtual bool GetCScript(const CScriptID &scriptid, CScript& script) const { return false; }
virtual bool HaveCScript(const CScriptID &scriptid) const { return false; } virtual bool HaveCScript(const CScriptID &scriptid) const { return false; }
virtual bool GetPubKey(const CKeyID &address, CPubKey& pubkey) const { return false; } virtual bool GetPubKey(const CKeyID &address, CPubKey& pubkey) const { return false; }

View file

@ -1061,7 +1061,7 @@ protected:
size_t nSize{0}; size_t nSize{0};
public: public:
SizeComputer() {} SizeComputer() = default;
void write(Span<const std::byte> src) void write(Span<const std::byte> src)
{ {

View file

@ -161,7 +161,7 @@ public:
typedef vector_type::const_iterator const_iterator; typedef vector_type::const_iterator const_iterator;
typedef vector_type::reverse_iterator reverse_iterator; typedef vector_type::reverse_iterator reverse_iterator;
explicit DataStream() {} explicit DataStream() = default;
explicit DataStream(Span<const uint8_t> sp) : DataStream{AsBytes(sp)} {} explicit DataStream(Span<const uint8_t> sp) : DataStream{AsBytes(sp)} {}
explicit DataStream(Span<const value_type> sp) : vch(sp.data(), sp.data() + sp.size()) {} explicit DataStream(Span<const value_type> sp) : vch(sp.data(), sp.data() + sp.size()) {}

View file

@ -46,9 +46,7 @@ Arena::Arena(void *base_in, size_t size_in, size_t alignment_in):
chunks_free_end.emplace(static_cast<char*>(base) + size_in, it); chunks_free_end.emplace(static_cast<char*>(base) + size_in, it);
} }
Arena::~Arena() Arena::~Arena() = default;
{
}
void* Arena::alloc(size_t size) void* Arena::alloc(size_t size)
{ {

View file

@ -19,7 +19,7 @@
class LockedPageAllocator class LockedPageAllocator
{ {
public: public:
virtual ~LockedPageAllocator() {} virtual ~LockedPageAllocator() = default;
/** Allocate and lock memory pages. /** Allocate and lock memory pages.
* If len is not a multiple of the system page size, it is rounded up. * If len is not a multiple of the system page size, it is rounded up.
* Returns nullptr in case of allocation failure. * Returns nullptr in case of allocation failure.

View file

@ -206,7 +206,7 @@ public:
protected: protected:
// needed for reverse_lock // needed for reverse_lock
UniqueLock() { } UniqueLock() = default;
public: public:
/** /**

View file

@ -71,7 +71,7 @@ class SCOPED_LOCKABLE StdLockGuard : public std::lock_guard<StdMutex>
{ {
public: public:
explicit StdLockGuard(StdMutex& cs) EXCLUSIVE_LOCK_FUNCTION(cs) : std::lock_guard<StdMutex>(cs) {} explicit StdLockGuard(StdMutex& cs) EXCLUSIVE_LOCK_FUNCTION(cs) : std::lock_guard<StdMutex>(cs) {}
~StdLockGuard() UNLOCK_FUNCTION() {} ~StdLockGuard() UNLOCK_FUNCTION() = default;
}; };
#endif // BITCOIN_THREADSAFETY_H #endif // BITCOIN_THREADSAFETY_H

View file

@ -507,8 +507,7 @@ namespace detail {
class FormatArg class FormatArg
{ {
public: public:
FormatArg() FormatArg() = default;
{ }
template<typename T> template<typename T>
explicit FormatArg(const T& value) explicit FormatArg(const T& value)

View file

@ -678,7 +678,7 @@ struct error
class Buffer class Buffer
{ {
public: public:
Buffer() {} Buffer() = default;
explicit Buffer(size_t cap) { buf.resize(cap); } explicit Buffer(size_t cap) { buf.resize(cap); }
void add_cap(size_t cap) { buf.resize(cap); } void add_cap(size_t cap) { buf.resize(cap); }

View file

@ -19,7 +19,7 @@ namespace util {
class TaskRunnerInterface class TaskRunnerInterface
{ {
public: public:
virtual ~TaskRunnerInterface() {} virtual ~TaskRunnerInterface() = default;
/** /**
* The callback can either be queued for later/asynchronous/threaded * The callback can either be queued for later/asynchronous/threaded

View file

@ -95,7 +95,7 @@ public:
ValidationSignals::ValidationSignals(std::unique_ptr<util::TaskRunnerInterface> task_runner) ValidationSignals::ValidationSignals(std::unique_ptr<util::TaskRunnerInterface> task_runner)
: m_internals{std::make_unique<ValidationSignalsImpl>(std::move(task_runner))} {} : m_internals{std::make_unique<ValidationSignalsImpl>(std::move(task_runner))} {}
ValidationSignals::~ValidationSignals() {} ValidationSignals::~ValidationSignals() = default;
void ValidationSignals::FlushBackgroundCallbacks() void ValidationSignals::FlushBackgroundCallbacks()
{ {

View file

@ -255,7 +255,7 @@ struct OutputGroup
/** Total weight of the UTXOs in this group. */ /** Total weight of the UTXOs in this group. */
int m_weight{0}; int m_weight{0};
OutputGroup() {} OutputGroup() = default;
OutputGroup(const CoinSelectionParams& params) : OutputGroup(const CoinSelectionParams& params) :
m_long_term_feerate(params.m_long_term_feerate), m_long_term_feerate(params.m_long_term_feerate),
m_subtract_fee_outputs(params.m_subtract_fee_outputs) m_subtract_fee_outputs(params.m_subtract_fee_outputs)

View file

@ -30,8 +30,8 @@ bool operator<(Span<const std::byte> a, BytePrefix b);
class DatabaseCursor class DatabaseCursor
{ {
public: public:
explicit DatabaseCursor() {} explicit DatabaseCursor() = default;
virtual ~DatabaseCursor() {} virtual ~DatabaseCursor() = default;
DatabaseCursor(const DatabaseCursor&) = delete; DatabaseCursor(const DatabaseCursor&) = delete;
DatabaseCursor& operator=(const DatabaseCursor&) = delete; DatabaseCursor& operator=(const DatabaseCursor&) = delete;
@ -56,8 +56,8 @@ private:
virtual bool HasKey(DataStream&& key) = 0; virtual bool HasKey(DataStream&& key) = 0;
public: public:
explicit DatabaseBatch() {} explicit DatabaseBatch() = default;
virtual ~DatabaseBatch() {} virtual ~DatabaseBatch() = default;
DatabaseBatch(const DatabaseBatch&) = delete; DatabaseBatch(const DatabaseBatch&) = delete;
DatabaseBatch& operator=(const DatabaseBatch&) = delete; DatabaseBatch& operator=(const DatabaseBatch&) = delete;
@ -131,7 +131,7 @@ class WalletDatabase
public: public:
/** Create dummy DB handle */ /** Create dummy DB handle */
WalletDatabase() : nUpdateCounter(0) {} WalletDatabase() : nUpdateCounter(0) {}
virtual ~WalletDatabase() {}; virtual ~WalletDatabase() = default;
/** Open the database if it is not already opened. */ /** Open the database if it is not already opened. */
virtual void Open() = 0; virtual void Open() = 0;

View file

@ -28,7 +28,7 @@ public:
{ {
if (open) Open(); if (open) Open();
} }
~BerkeleyRODatabase(){}; ~BerkeleyRODatabase() = default;
BerkeleyROData m_records; BerkeleyROData m_records;
@ -81,7 +81,7 @@ private:
public: public:
explicit BerkeleyROCursor(const BerkeleyRODatabase& database, Span<const std::byte> prefix = {}); explicit BerkeleyROCursor(const BerkeleyRODatabase& database, Span<const std::byte> prefix = {});
~BerkeleyROCursor() {} ~BerkeleyROCursor() = default;
Status Next(DataStream& key, DataStream& value) override; Status Next(DataStream& key, DataStream& value) override;
}; };
@ -102,7 +102,7 @@ private:
public: public:
explicit BerkeleyROBatch(const BerkeleyRODatabase& database) : m_database(database) {} explicit BerkeleyROBatch(const BerkeleyRODatabase& database) : m_database(database) {}
~BerkeleyROBatch() {} ~BerkeleyROBatch() = default;
BerkeleyROBatch(const BerkeleyROBatch&) = delete; BerkeleyROBatch(const BerkeleyROBatch&) = delete;
BerkeleyROBatch& operator=(const BerkeleyROBatch&) = delete; BerkeleyROBatch& operator=(const BerkeleyROBatch&) = delete;

View file

@ -178,7 +178,7 @@ protected:
public: public:
explicit ScriptPubKeyMan(WalletStorage& storage) : m_storage(storage) {} explicit ScriptPubKeyMan(WalletStorage& storage) : m_storage(storage) {}
virtual ~ScriptPubKeyMan() {}; virtual ~ScriptPubKeyMan() = default;
virtual util::Result<CTxDestination> GetNewDestination(const OutputType type) { return util::Error{Untranslated("Not supported")}; } virtual util::Result<CTxDestination> GetNewDestination(const OutputType type) { return util::Error{Untranslated("Not supported")}; }
virtual isminetype IsMine(const CScript& script) const { return ISMINE_NO; } virtual isminetype IsMine(const CScript& script) const { return ISMINE_NO; }

View file

@ -26,7 +26,7 @@ public:
std::vector<std::byte> m_prefix_range_start; std::vector<std::byte> m_prefix_range_start;
std::vector<std::byte> m_prefix_range_end; std::vector<std::byte> m_prefix_range_end;
explicit SQLiteCursor() {} explicit SQLiteCursor() = default;
explicit SQLiteCursor(std::vector<std::byte> start_range, std::vector<std::byte> end_range) explicit SQLiteCursor(std::vector<std::byte> start_range, std::vector<std::byte> end_range)
: m_prefix_range_start(std::move(start_range)), : m_prefix_range_start(std::move(start_range)),
m_prefix_range_end(std::move(end_range)) m_prefix_range_end(std::move(end_range))
@ -41,7 +41,7 @@ public:
class SQliteExecHandler class SQliteExecHandler
{ {
public: public:
virtual ~SQliteExecHandler() {} virtual ~SQliteExecHandler() = default;
virtual int Exec(SQLiteDatabase& database, const std::string& statement); virtual int Exec(SQLiteDatabase& database, const std::string& statement);
}; };

View file

@ -61,7 +61,7 @@ public:
explicit MockableCursor(const MockableData& records, bool pass) : m_cursor(records.begin()), m_cursor_end(records.end()), m_pass(pass) {} explicit MockableCursor(const MockableData& records, bool pass) : m_cursor(records.begin()), m_cursor_end(records.end()), m_pass(pass) {}
MockableCursor(const MockableData& records, bool pass, Span<const std::byte> prefix); MockableCursor(const MockableData& records, bool pass, Span<const std::byte> prefix);
~MockableCursor() {} ~MockableCursor() = default;
Status Next(DataStream& key, DataStream& value) override; Status Next(DataStream& key, DataStream& value) override;
}; };
@ -80,7 +80,7 @@ private:
public: public:
explicit MockableBatch(MockableData& records, bool pass) : m_records(records), m_pass(pass) {} explicit MockableBatch(MockableData& records, bool pass) : m_records(records), m_pass(pass) {}
~MockableBatch() {} ~MockableBatch() = default;
void Flush() override {} void Flush() override {}
void Close() override {} void Close() override {}
@ -106,7 +106,7 @@ public:
bool m_pass{true}; bool m_pass{true};
MockableDatabase(MockableData records = {}) : WalletDatabase(), m_records(records) {} MockableDatabase(MockableData records = {}) : WalletDatabase(), m_records(records) {}
~MockableDatabase() {}; ~MockableDatabase() = default;
void Open() override {} void Open() override {}
void AddRef() override {} void AddRef() override {}

View file

@ -111,7 +111,7 @@ public:
SER_READ(obj, obj.DeserializeDescriptor(descriptor_str)); SER_READ(obj, obj.DeserializeDescriptor(descriptor_str));
} }
WalletDescriptor() {} WalletDescriptor() = default;
WalletDescriptor(std::shared_ptr<Descriptor> descriptor, uint64_t creation_time, int32_t range_start, int32_t range_end, int32_t next_index) : descriptor(descriptor), id(DescriptorID(*descriptor)), creation_time(creation_time), range_start(range_start), range_end(range_end), next_index(next_index) { } WalletDescriptor(std::shared_ptr<Descriptor> descriptor, uint64_t creation_time, int32_t range_start, int32_t range_end, int32_t next_index) : descriptor(descriptor), id(DescriptorID(*descriptor)), creation_time(creation_time), range_start(range_start), range_end(range_end), next_index(next_index) { }
}; };

View file

@ -22,7 +22,7 @@ public:
/** Add wallets that should be opened to list of chain clients. */ /** Add wallets that should be opened to list of chain clients. */
virtual void Construct(node::NodeContext& node) const = 0; virtual void Construct(node::NodeContext& node) const = 0;
virtual ~WalletInitInterface() {} virtual ~WalletInitInterface() = default;
}; };
extern const WalletInitInterface& g_wallet_init_interface; extern const WalletInitInterface& g_wallet_init_interface;

View file

@ -24,9 +24,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
CZMQNotificationInterface::CZMQNotificationInterface() CZMQNotificationInterface::CZMQNotificationInterface() = default;
{
}
CZMQNotificationInterface::~CZMQNotificationInterface() CZMQNotificationInterface::~CZMQNotificationInterface()
{ {