Merge bitcoin/bitcoin#36820: refactor: remove more dead code
What changed, and why it matters
This commit is a large cleanup that removes unused variables, unused function parameters, dead code paths, and commented-out code across Bitcoin Core. None of the changes alter how the software behaves or processes untrusted data; they only delete things that were not being used. There is no indication of a security vulnerability being fixed.
No security action required. Treat as normal code-quality refactoring.
Security signals we found
No security-relevant signals present
Pure refactoring / dead-code removal
No changes to consensus, networking, cryptography, or input validation logic
Evidence from the diff
The merge commit removes dead code across many modules: unused MuSig2 nonce parameters, unused Qt constants and cached node lists, unused RPCConsole message classes, unused fee-estimator fields, unused policy flags, unused serialization helpers, unused wallet helper methods, a no-op InterruptREST function, and similar cleanups. The only user-visible behavioral change is in noui.cpp and qt/bitcoingui.cpp where the SECURE message-box flag is removed; messages that previously would have been suppressed from logs are now always logged. This is a functional simplification, not a vulnerability fix, and the flag was already documented as unused in the Qt GUI.
Changed components
src/bench/crypto_hash.cppsrc/bitcoin-chainstate.cppsrc/bitcoind.cppsrc/httprpc.hsrc/init.cppsrc/net.hsrc/node/interface_ui.hsrc/noui.cppsrc/policy/fees/block_policy_estimator.cppsrc/policy/fees/block_policy_estimator.hsrc/policy/policy.hsrc/qt/bitcoingui.cppsrc/qt/clientmodel.hsrc/qt/psbtoperationsdialog.cppsrc/qt/psbtoperationsdialog.hsrc/qt/rpcconsole.cppsrc/qt/rpcconsole.hsrc/rest.cppsrc/rpc/blockchain.cppsrc/script/descriptor.cppsrc/script/sign.cppsrc/script/sign.hsrc/serialize.hsrc/test/miner_tests.cppsrc/test/orphanage_tests.cppsrc/torcontrol.cppsrc/util/insert.hsrc/util/tokenbucket.hsrc/wallet/spend.hsrc/wallet/walletdb.cppInspect captured patch +22 / −134
### src/bench/crypto_hash.cpp
@@ -281,7 +281,6 @@ static void MuHashDiv(benchmark::Bench& bench)
static void MuHashPrecompute(benchmark::Bench& bench)
{
- MuHash3072 acc;
FastRandomContext rng(true);
std::vector<unsigned char> key{rng.randbytes(32)};
### src/bitcoin-chainstate.cpp
@@ -17,7 +17,6 @@
#include <charconv>
#include <filesystem>
#include <iostream>
-#include <optional>
#include <string>
#include <string_view>
#include <vector>
@@ -58,8 +57,6 @@ class TestValidationInterface : public ValidationInterface
public:
TestValidationInterface() = default;
- std::optional<std::string> m_expected_valid_block = std::nullopt;
-
void BlockChecked(Block block, BlockValidationStateView state) override
{
auto mode{state.GetValidationMode()};
### src/bitcoind.cpp
@@ -30,7 +30,6 @@
#include <util/tokenpipe.h>
#include <util/translation.h>
-#include <any>
#include <functional>
#include <optional>
@@ -179,7 +178,6 @@ static bool AppInit(NodeContext& node)
// end, which is interpreted as failure to start.
TokenPipeEnd daemon_ep;
#endif
- std::any context{&node};
try
{
// -server defaults to true for bitcoind but not for the GUI so do this here
### src/httprpc.h
@@ -32,9 +32,6 @@ UniValue ExecuteHTTPRPC(const UniValue& valRequest, JSONRPCRequest& jreq, HTTPSt
* Precondition; HTTP and RPC has been started.
*/
void StartREST(const std::any& context);
-/** Interrupt RPC REST subsystem.
- */
-void InterruptREST();
/** Stop HTTP REST subsystem.
* Precondition; HTTP and RPC has been stopped.
*/
### src/init.cpp
@@ -298,7 +298,6 @@ void Interrupt(NodeContext& node)
InterruptHTTPServer();
InterruptHTTPRPC();
InterruptRPC();
- InterruptREST();
if (node.tor_controller) {
node.tor_controller->Interrupt();
}
### src/net.h
@@ -1297,15 +1297,6 @@ class CConnman
}
};
- void ForEachNode(const NodeFn& func) const EXCLUSIVE_LOCKS_REQUIRED(!m_nodes_mutex)
- {
- LOCK(m_nodes_mutex);
- for (auto&& node : m_nodes) {
- if (NodeFullyConnected(node))
- func(node);
- }
- };
-
// Addrman functions
/**
* Return randomly selected addresses. This function does not use the address response cache and
### src/node/interface_ui.h
@@ -26,11 +26,6 @@ class CClientUIInterface
ICON_INFORMATION = 0,
ICON_WARNING = (1U << 0),
ICON_ERROR = (1U << 1),
- /**
- * Mask of all available icons in CClientUIInterface::MessageBoxFlags
- * This needs to be updated, when icons are changed there!
- */
- ICON_MASK = (ICON_INFORMATION | ICON_WARNING | ICON_ERROR),
/** These values are taken from qmessagebox.h "enum StandardButton" to be directly usable */
BTN_OK = 0x00000400U, // QMessageBox::Ok
@@ -55,9 +50,6 @@ class CClientUIInterface
/** Force blocking, modal message box dialog (not just OS notification) */
MODAL = 0x10000000U,
- /** Do not print contents of message to debug log */
- SECURE = 0x40000000U,
-
/** Predefined combinations for certain default usage cases */
MSG_INFORMATION = ICON_INFORMATION,
MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL),
### src/noui.cpp
@@ -19,25 +19,22 @@ btcsignals::connection noui_InitMessageConn;
void noui_ThreadSafeMessageBox(const bilingual_str& message, unsigned int style)
{
- bool fSecure = style & CClientUIInterface::SECURE;
- style &= ~CClientUIInterface::SECURE;
-
std::string strCaption;
switch (style) {
case CClientUIInterface::MSG_ERROR:
strCaption = "Error: ";
- if (!fSecure) LogError("%s\n", message.original);
+ LogError("%s", message.original);
break;
case CClientUIInterface::MSG_WARNING:
strCaption = "Warning: ";
- if (!fSecure) LogWarning("%s\n", message.original);
+ LogWarning("%s", message.original);
break;
case CClientUIInterface::MSG_INFORMATION:
strCaption = "Information: ";
- if (!fSecure) LogInfo("%s\n", message.original);
+ LogInfo("%s", message.original);
break;
default:
- if (!fSecure) LogInfo("%s%s\n", strCaption, message.original);
+ LogInfo("%s", message.original);
}
tfm::format(std::cerr, "%s%s\n", strCaption, message.original);
### src/policy/fees/block_policy_estimator.cpp
@@ -880,7 +880,6 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, FeeCalculation
feeCalc->desiredTarget = confTarget;
feeCalc->returnedTarget = confTarget;
- feeCalc->best_height = nBestSeenHeight;
double median = -1;
EstimationResult tempResult;
### src/policy/fees/block_policy_estimator.h
@@ -91,7 +91,6 @@ struct FeeCalculation
BlockPolicyEstimateReason reason = BlockPolicyEstimateReason::NONE;
int desiredTarget = 0;
int returnedTarget = 0;
- unsigned int best_height{0};
};
/** \class CBlockPolicyEstimator
### src/policy/policy.h
@@ -124,9 +124,6 @@ inline constexpr script_verify_flags STANDARD_SCRIPT_VERIFY_FLAGS{MANDATORY_SCRI
SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS |
SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE};
-/** For convenience, standard but not mandatory verify flags. */
-inline constexpr script_verify_flags STANDARD_NOT_MANDATORY_VERIFY_FLAGS{STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS};
-
/** Used as the flags parameter to sequence and nLocktime checks in non-consensus code. */
inline constexpr unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS{LOCKTIME_VERIFY_SEQUENCE};
### src/qt/bitcoingui.cpp
@@ -1609,9 +1609,6 @@ void BitcoinGUI::showModalOverlay()
[[nodiscard]] static bool ThreadSafeMessageBox(BitcoinGUI* gui, const bilingual_str& message, unsigned int style)
{
bool modal = (style & CClientUIInterface::MODAL);
- // The SECURE flag has no effect in the Qt GUI.
- // bool secure = (style & CClientUIInterface::SECURE);
- style &= ~CClientUIInterface::SECURE;
bool ret = false;
QString detailed_message; // This is original message, in English, for googling and referencing.
### src/qt/clientmodel.h
@@ -46,7 +46,6 @@ enum class SyncType {
};
enum NumConnections {
- CONNECTIONS_NONE = 0,
CONNECTIONS_IN = (1U << 0),
CONNECTIONS_OUT = (1U << 1),
CONNECTIONS_ALL = (CONNECTIONS_IN | CONNECTIONS_OUT),
### src/qt/psbtoperationsdialog.cpp
@@ -247,7 +247,7 @@ void PSBTOperationsDialog::showStatus(const QString &msg, StatusLevel level) {
m_ui->statusBar->show();
}
-size_t PSBTOperationsDialog::couldSignInputs(const PartiallySignedTransaction &psbtx) {
+size_t PSBTOperationsDialog::couldSignInputs() {
if (!m_wallet_model) {
return 0;
}
@@ -264,7 +264,7 @@ size_t PSBTOperationsDialog::couldSignInputs(const PartiallySignedTransaction &p
void PSBTOperationsDialog::showTransactionStatus(const PartiallySignedTransaction &psbtx) {
PSBTAnalysis analysis = AnalyzePSBT(psbtx);
- size_t n_could_sign = couldSignInputs(psbtx);
+ size_t n_could_sign = couldSignInputs();
switch (analysis.next) {
case PSBTRole::UPDATER: {
### src/qt/psbtoperationsdialog.h
@@ -45,7 +45,7 @@ public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
Error
};
- size_t couldSignInputs(const PartiallySignedTransaction &psbtx);
+ size_t couldSignInputs();
void updateTransactionDisplay();
QString renderTransaction(const PartiallySignedTransaction &psbtx);
void showStatus(const QString &msg, StatusLevel level);
### src/qt/rpcconsole.cpp
@@ -1333,7 +1333,6 @@ void RPCConsole::unbanSelectedNode()
void RPCConsole::clearSelectedNode()
{
ui->peerWidget->selectionModel()->clearSelection();
- cachedNodeids.clear();
updateDetailWidget();
}
### src/qt/rpcconsole.h
@@ -61,8 +61,6 @@ class RPCConsole: public QWidget
#endif // ENABLE_WALLET
enum MessageClass {
- MC_ERROR,
- MC_DEBUG,
CMD_REQUEST,
CMD_REPLY,
CMD_ERROR
@@ -166,7 +164,6 @@ public Q_SLOTS:
QStringList history;
int historyPtr = 0;
QString cmdBeforeBrowsing;
- QList<NodeId> cachedNodeids;
const PlatformStyle* const platformStyle;
QMenu *peersTableContextMenu = nullptr;
QMenu *banTableContextMenu = nullptr;
### src/rest.cpp
@@ -1230,10 +1230,6 @@ void StartREST(const std::any& context)
}
}
-void InterruptREST()
-{
-}
-
void StopREST()
{
for (const auto& up : uri_prefixes) {
### src/rpc/blockchain.cpp
@@ -2455,7 +2455,6 @@ static RPCMethod scantxoutset()
// Scan the unspent transaction output set for inputs
UniValue unspents(UniValue::VARR);
- std::vector<CTxOut> input_txos;
std::map<COutPoint, Coin> coins;
g_should_abort_scan = false;
int64_t count = 0;
@@ -2481,7 +2480,6 @@ static RPCMethod scantxoutset()
const Coin& coin = it.second;
const CTxOut& txo = coin.out;
const CBlockIndex& coinb_block{*CHECK_NONFATAL(tip->GetAncestor(coin.nHeight))};
- input_txos.push_back(txo);
total_in += txo.nValue;
UniValue unspent(UniValue::VOBJ);
### src/script/descriptor.cpp
@@ -2277,7 +2277,7 @@ std::unique_ptr<PubkeyProvider> InferPubkey(const CPubKey& pubkey, ParseScriptCo
return key_provider;
}
-std::unique_ptr<PubkeyProvider> InferXOnlyPubkey(const XOnlyPubKey& xkey, ParseScriptContext ctx, const SigningProvider& provider)
+std::unique_ptr<PubkeyProvider> InferXOnlyPubkey(const XOnlyPubKey& xkey, const SigningProvider& provider)
{
CPubKey pubkey{xkey.GetEvenCorrespondingCPubKey()};
std::unique_ptr<PubkeyProvider> key_provider = std::make_unique<ConstPubkeyProvider>(0, pubkey, true);
@@ -2357,7 +2357,7 @@ struct KeyParser {
if (miniscript::IsTapscript(m_script_ctx) && end - begin == 32) {
XOnlyPubKey pubkey;
std::copy(begin, end, pubkey.begin());
- if (auto pubkey_provider = InferXOnlyPubkey(pubkey, ParseContext(), *m_in)) {
+ if (auto pubkey_provider = InferXOnlyPubkey(pubkey, *m_in)) {
m_keys.emplace_back();
m_keys.back().push_back(std::move(pubkey_provider));
return key;
@@ -2822,15 +2822,15 @@ std::vector<std::unique_ptr<DescriptorImpl>> ParseScript(uint32_t& key_exp_index
return {};
}
-std::unique_ptr<DescriptorImpl> InferMultiA(const CScript& script, ParseScriptContext ctx, const SigningProvider& provider)
+std::unique_ptr<DescriptorImpl> InferMultiA(const CScript& script, const SigningProvider& provider)
{
auto match = MatchMultiA(script);
if (!match) return {};
std::vector<std::unique_ptr<PubkeyProvider>> keys;
keys.reserve(match->second.size());
for (const auto keyspan : match->second) {
if (keyspan.size() != 32) return {};
- auto key = InferXOnlyPubkey(XOnlyPubKey{keyspan}, ctx, provider);
+ auto key = InferXOnlyPubkey(XOnlyPubKey{keyspan}, provider);
if (!key) return {};
keys.push_back(std::move(key));
}
@@ -2842,11 +2842,11 @@ std::unique_ptr<DescriptorImpl> InferScript(const CScript& script, ParseScriptCo
{
if (ctx == ParseScriptContext::P2TR && script.size() == 34 && script[0] == 32 && script[33] == OP_CHECKSIG) {
XOnlyPubKey key{std::span{script}.subspan(1, 32)};
- return std::make_unique<PKDescriptor>(InferXOnlyPubkey(key, ctx, provider), true);
+ return std::make_unique<PKDescriptor>(InferXOnlyPubkey(key, provider), true);
}
if (ctx == ParseScriptContext::P2TR) {
- auto ret = InferMultiA(script, ctx, provider);
+ auto ret = InferMultiA(script, provider);
if (ret) return ret;
}
@@ -2938,14 +2938,14 @@ std::unique_ptr<DescriptorImpl> InferScript(const CScript& script, ParseScriptCo
}
}
if (ok) {
- auto key = InferXOnlyPubkey(tap.internal_key, ParseScriptContext::P2TR, provider);
+ auto key = InferXOnlyPubkey(tap.internal_key, provider);
return std::make_unique<TRDescriptor>(std::move(key), std::move(subscripts), std::move(depths));
}
}
}
// If the above doesn't work, construct a rawtr() descriptor with just the encoded x-only pubkey.
if (pubkey.IsFullyValid()) {
- auto key = InferXOnlyPubkey(pubkey, ParseScriptContext::P2TR, provider);
+ auto key = InferXOnlyPubkey(pubkey, provider);
if (key) {
return std::make_unique<RawTRDescriptor>(std::move(key));
}
### src/script/sign.cpp
@@ -120,7 +120,7 @@ bool MutableTransactionSignatureCreator::CreateSchnorrSig(const SigningProvider&
return true;
}
-std::vector<uint8_t> MutableTransactionSignatureCreator::CreateMuSig2Nonce(const SigningProvider& provider, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, const uint256* merkle_root, SigVersion sigversion, const SignatureData& sigdata) const
+std::vector<uint8_t> MutableTransactionSignatureCreator::CreateMuSig2Nonce(const SigningProvider& provider, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, SigVersion sigversion, const SignatureData& sigdata) const
{
assert(sigversion == SigVersion::TAPROOT || sigversion == SigVersion::TAPSCRIPT);
@@ -370,7 +370,7 @@ static bool SignMuSig2(const BaseSignatureCreator& creator, SignatureData& sigda
std::map<CPubKey, std::vector<uint8_t>>& pubnonces = sigdata.musig2_pubnonces[pub_key_leaf_hash];
for (const CPubKey& part_pk : part_pks) {
if (pubnonces.contains(part_pk)) continue;
- std::vector<uint8_t> pubnonce = creator.CreateMuSig2Nonce(provider, agg_pub, plain_pub, part_pk, leaf_hash, merkle_root, sigversion, sigdata);
+ std::vector<uint8_t> pubnonce = creator.CreateMuSig2Nonce(provider, agg_pub, plain_pub, part_pk, leaf_hash, sigversion, sigdata);
if (pubnonce.empty()) continue;
pubnonces[part_pk] = std::move(pubnonce);
}
@@ -985,7 +985,7 @@ class DummySignatureCreator final : public BaseSignatureCreator {
sig.assign(64, '\000');
return true;
}
- std::vector<uint8_t> CreateMuSig2Nonce(const SigningProvider& provider, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, const uint256* merkle_root, SigVersion sigversion, const SignatureData& sigdata) const override
+ std::vector<uint8_t> CreateMuSig2Nonce(const SigningProvider& provider, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, SigVersion sigversion, const SignatureData& sigdata) const override
{
std::vector<uint8_t> out;
out.assign(MUSIG2_PUBNONCE_SIZE, '\000');
### src/script/sign.h
@@ -44,7 +44,7 @@ class BaseSignatureCreator {
/** Create a singular (non-script) signature. */
virtual bool CreateSig(const SigningProvider& provider, std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const =0;
virtual bool CreateSchnorrSig(const SigningProvider& provider, std::vector<unsigned char>& sig, const XOnlyPubKey& pubkey, const uint256* leaf_hash, const uint256* merkle_root, SigVersion sigversion) const =0;
- virtual std::vector<uint8_t> CreateMuSig2Nonce(const SigningProvider& provider, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, const uint256* merkle_root, SigVersion sigversion, const SignatureData& sigdata) const =0;
+ virtual std::vector<uint8_t> CreateMuSig2Nonce(const SigningProvider& provider, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, SigVersion sigversion, const SignatureData& sigdata) const =0;
virtual bool CreateMuSig2PartialSig(const SigningProvider& provider, uint256& partial_sig, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, const std::vector<std::pair<uint256, bool>>& tweaks, SigVersion sigversion, const SignatureData& sigdata) const =0;
virtual bool CreateMuSig2AggregateSig(const std::vector<CPubKey>& participants, std::vector<uint8_t>& sig, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const uint256* leaf_hash, const std::vector<std::pair<uint256, bool>>& tweaks, SigVersion sigversion, const SignatureData& sigdata) const =0;
};
@@ -67,7 +67,7 @@ class MutableTransactionSignatureCreator : public BaseSignatureCreator
const BaseSignatureChecker& Checker() const override { return checker; }
bool CreateSig(const SigningProvider& provider, std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const override;
bool CreateSchnorrSig(const SigningProvider& provider, std::vector<unsigned char>& sig, const XOnlyPubKey& pubkey, const uint256* leaf_hash, const uint256* merkle_root, SigVersion sigversion) const override;
- std::vector<uint8_t> CreateMuSig2Nonce(const SigningProvider& provider, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, const uint256* merkle_root, SigVersion sigversion, const SignatureData& sigdata) const override;
+ std::vector<uint8_t> CreateMuSig2Nonce(const SigningProvider& provider, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, SigVersion sigversion, const SignatureData& sigdata) const override;
bool CreateMuSig2PartialSig(const SigningProvider& provider, uint256& partial_sig, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const CPubKey& part_pubkey, const uint256* leaf_hash, const std::vector<std::pair<uint256, bool>>& tweaks, SigVersion sigversion, const SignatureData& sigdata) const override;
bool CreateMuSig2AggregateSig(const std::vector<CPubKey>& participants, std::vector<uint8_t>& sig, const CPubKey& aggregate_pubkey, const CPubKey& script_pubkey, const uint256* leaf_hash, const std::vector<std::pair<uint256, bool>>& tweaks, SigVersion sigversion, const SignatureData& sigdata) const override;
};
### src/serialize.h
@@ -392,23 +392,6 @@ struct CheckVarIntMode {
}
};
-template<VarIntMode Mode, typename I>
-inline unsigned int GetSizeOfVarInt(I n)
-{
- CheckVarIntMode<Mode, I>();
- int nRet = 0;
- while(true) {
- nRet++;
- if (n <= 0x7F)
- break;
- n = (n >> 7) - 1;
- }
- return nRet;
-}
-
-template<typename I>
-inline void WriteVarInt(SizeComputer& os, I n);
-
template<typename Stream, VarIntMode Mode, typename I>
void WriteVarInt(Stream& os, I n)
{
@@ -734,12 +717,6 @@ template<typename Stream, typename K, typename Pred, typename A> void Unserializ
template<typename Stream, typename T> void Serialize(Stream& os, const std::shared_ptr<const T>& p);
template<typename Stream, typename T> void Unserialize(Stream& os, std::shared_ptr<const T>& p);
-/**
- * unique_ptr
- */
-template<typename Stream, typename T> void Serialize(Stream& os, const std::unique_ptr<const T>& p);
-template<typename Stream, typename T> void Unserialize(Stream& os, std::unique_ptr<const T>& p);
-
/**
* If none of the specialized versions above matched, default to calling member function.
@@ -992,23 +969,6 @@ void Unserialize(Stream& is, std::set<K, Pred, A>& m)
-/**
- * unique_ptr
- */
-template<typename Stream, typename T> void
-Serialize(Stream& os, const std::unique_ptr<const T>& p)
-{
- Serialize(os, *p);
-}
-
-template<typename Stream, typename T>
-void Unserialize(Stream& is, std::unique_ptr<const T>& p)
-{
- p.reset(new T(deserialize, is));
-}
-
-
-
/**
* shared_ptr
*/
@@ -1127,12 +1087,6 @@ class SizeComputer
}
};
-template<typename I>
-inline void WriteVarInt(SizeComputer &s, I n)
-{
- s.seek(GetSizeOfVarInt<I>(n));
-}
-
inline void WriteCompactSize(SizeComputer &s, uint64_t nSize)
{
s.seek(GetSizeOfCompactSize(nSize));
### src/test/miner_tests.cpp
@@ -417,7 +417,6 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
// Just to make sure we can still make simple blocks
auto block_template{mining->createNewBlock(options, /*cooldown=*/false)};
BOOST_REQUIRE(block_template);
- CBlock block{block_template->getBlock()};
auto txs = CreateBigSigOpsCluster(txFirst[0]);
@@ -444,7 +443,6 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
// Just to make sure we can still make simple blocks
auto block_template{mining->createNewBlock(options, /*cooldown=*/false)};
BOOST_REQUIRE(block_template);
- CBlock block{block_template->getBlock()};
auto txs = CreateBigSigOpsCluster(txFirst[0]);
### src/test/orphanage_tests.cpp
@@ -396,7 +396,6 @@ BOOST_AUTO_TEST_CASE(peer_dos_limits)
}
for (unsigned int i{0}; i < 10; ++i) {
- CMutableTransaction tx;
std::shuffle(outpoints_50.begin(), outpoints_50.end(), m_rng);
auto ptx = MakeTransactionSpending(outpoints_50, m_rng);
BOOST_CHECK(orphanage->AddTx(ptx, 0));
### src/torcontrol.cpp
@@ -707,7 +707,6 @@ void TorController::protocolinfo_cb(TorControlConnection& _conn, const TorContro
LogDebug(BCLog::TOR, "Using SAFECOOKIE authentication, reading cookie authentication from %s", cookiefile);
std::pair<bool,std::string> status_cookie = ReadBinaryFile(fs::PathFromString(cookiefile), TOR_COOKIE_SIZE);
if (status_cookie.first && status_cookie.second.size() == TOR_COOKIE_SIZE) {
- // _conn.Command("AUTHENTICATE " + HexStr(status_cookie.second), std::bind_front(&TorController::auth_cb, this));
m_cookie = std::vector<uint8_t>(status_cookie.second.begin(), status_cookie.second.end());
m_client_nonce = std::vector<uint8_t>(TOR_NONCE_SIZE, 0);
GetRandBytes(m_client_nonce);
### src/util/insert.h
@@ -10,15 +10,6 @@
namespace util {
//! Simplification of std insertion
-template <typename Tdst, typename Tsrc>
-inline void insert(Tdst& dst, const Tsrc& src) {
- dst.insert(dst.begin(), src.begin(), src.end());
-}
-template <typename TsetT, typename Tsrc>
-inline void insert(std::set<TsetT>& dst, const Tsrc& src) {
- dst.insert(src.begin(), src.end());
-}
-
template <typename TsetT, typename Compare, typename Tsrc>
inline void insert(std::set<TsetT, Compare>& dst, const Tsrc& src) {
dst.insert(src.begin(), src.end());
### src/util/tokenbucket.h
@@ -23,9 +23,7 @@ template <typename Clock>
class TokenBucket
{
public:
- using clock = Clock;
using time_point = typename Clock::time_point;
- using duration = typename Clock::duration;
const double m_rate{1}; //!< Tokens added per second
const double m_cap{0}; //!< Maximum token balance
### src/wallet/spend.h
@@ -51,8 +51,6 @@ struct CoinsResult {
/** The following methods are provided so that CoinsResult can mimic a vector,
* i.e., methods can work with individual OutputType vectors or on the entire object */
size_t Size() const;
- /** Return how many different output types this struct stores */
- size_t TypesCount() const { return coins.size(); }
void Erase(const std::unordered_set<COutPoint, SaltedOutpointHasher>& coins_to_remove);
void Shuffle(FastRandomContext& rng_fast);
void Add(OutputType type, const COutput& out);
### src/wallet/walletdb.cpp
@@ -550,7 +550,7 @@ bool HasLegacyRecords(CWallet& wallet, DatabaseBatch& batch)
return false;
}
-static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch, int last_client) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)
+static DBErrors LoadLegacyWalletRecords(CWallet* pwallet, DatabaseBatch& batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)
{
AssertLockHeld(pwallet->cs_wallet);
DBErrors result = DBErrors::LOAD_OK;
@@ -1184,7 +1184,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
#endif
// Load legacy wallet keys
- result = std::max(LoadLegacyWalletRecords(pwallet, *m_batch, last_client), result);
+ result = std::max(LoadLegacyWalletRecords(pwallet, *m_batch), result);
// Load descriptors
result = std::max(LoadDescriptorWalletRecords(pwallet, *m_batch, last_client), result);Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.