Merge bitcoin/bitcoin#36744: refactor: fix mismatched and undefined declarations
What changed, and why it matters
This is a routine code cleanup that removes or fixes function declarations which did not match any actual function definition. It does not change program behavior, fix a bug, or close a security hole. Two helper functions were made 'static' (only usable inside their own source file), two unused declarations were removed from headers, and one declaration was updated to use the exact same type as its definition. There is no security impact.
No action required. This is a safe cleanup commit. Treat as normal maintenance.
Security signals we found
No security-relevant signal present
Pure refactor / dead-code removal
No functional change to consensus, networking, wallet, or RPC behavior
Evidence from the diff
The merge commit is a pure refactor (PR #36744). It addresses mismatched/undefined declarations: (1) FeeModeInfo is made static and its mismatched header declaration is removed; (2) AddInputs is made static and its mismatched header declaration is removed; (3) HTTPRemoteClient::ShouldDisconnect declaration is changed from std::chrono::time_point
Changed components
src/common/messages.cppsrc/common/messages.hsrc/httpserver.hsrc/qt/bantablemodel.hsrc/rpc/rawtransaction_util.cppsrc/rpc/rawtransaction_util.hsrc/rpc/util.hInspect captured patch +4 / −14
### src/common/messages.cpp
@@ -61,7 +61,7 @@ const std::vector<std::pair<std::string, FeeEstimateMode>>& FeeModeMap()
return FEE_MODES;
}
-std::string FeeModeInfo(const std::pair<std::string, FeeEstimateMode>& mode, std::string& default_info)
+static std::string FeeModeInfo(const std::pair<std::string, FeeEstimateMode>& mode, std::string& default_info)
{
switch (mode.second) {
case FeeEstimateMode::UNSET:
### src/common/messages.h
@@ -13,7 +13,6 @@
#include <string>
#include <string_view>
-#include <utility>
struct bilingual_str;
enum class FeeEstimateMode;
@@ -29,7 +28,6 @@ bool FeeModeFromString(std::string_view mode_string, FeeEstimateMode& fee_estima
std::string StringForFeeReason(FeeReason reason);
std::string FeeReasons(const std::string& delimiter);
std::string FeeModes(const std::string& delimiter);
-std::string FeeModeInfo(std::pair<std::string, FeeEstimateMode>& mode);
std::string FeeModesDetail(std::string default_info);
std::string InvalidEstimateModeErrorMessage();
bilingual_str PSBTErrorString(PSBTError error);
### src/httpserver.h
@@ -519,7 +519,7 @@ class HTTPRemoteClient
void Send(const HTTPResponse& res, std::span<const std::byte> reply_body, bool keep_alive) EXCLUSIVE_LOCKS_REQUIRED(!m_send_mutex, !m_sock_mutex);
void Receive() EXCLUSIVE_LOCKS_REQUIRED(!m_sock_mutex);
- bool ShouldDisconnect(std::chrono::time_point<MockableSteadyClock> now, std::chrono::seconds rpcservertimeout, bool disconnect_all) const;
+ bool ShouldDisconnect(MockableSteadyClock::time_point now, std::chrono::seconds rpcservertimeout, bool disconnect_all) const;
/**
* Try to read an HTTPRequest from a client's receive buffer.
### src/qt/bantablemodel.h
@@ -47,8 +47,6 @@ class BanTableModel : public QAbstractTableModel
public:
explicit BanTableModel(interfaces::Node& node, QObject* parent);
~BanTableModel();
- void startAutoRefresh();
- void stopAutoRefresh();
enum ColumnIndex {
Address = 0,
### src/rpc/rawtransaction_util.cpp
@@ -32,7 +32,8 @@
#include <span>
#include <variant>
-void AddInputs(CMutableTransaction& rawTx, const UniValue& inputs_in, std::optional<bool> rbf)
+/** Normalize univalue-represented inputs and add them to the transaction */
+static void AddInputs(CMutableTransaction& rawTx, const UniValue& inputs_in, std::optional<bool> rbf)
{
UniValue inputs;
if (inputs_in.isNull()) {
### src/rpc/rawtransaction_util.h
@@ -45,9 +45,6 @@ void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const
*/
void ParsePrevouts(const UniValue& prevTxsUnival, FlatSigningProvider* keystore, std::map<COutPoint, Coin>& coins);
-/** Normalize univalue-represented inputs and add them to the transaction */
-void AddInputs(CMutableTransaction& rawTx, const UniValue& inputs_in, bool rbf);
-
/** Normalize univalue-represented outputs */
UniValue NormalizeOutputs(const UniValue& outputs_in);
### src/rpc/util.h
@@ -395,10 +395,6 @@ struct RPCResult {
/** Append the sections of the result. */
void ToSections(Sections& sections, OuterType outer_type = OuterType::NONE, int current_indent = 0) const;
- /** Return the type string of the result when it is in an object (dict). */
- std::string ToStringObj() const;
- /** Return the description string, including the result type. */
- std::string ToDescriptionString() const;
/** Check whether the result JSON type matches.
* Returns true if type matches, or object describing error(s) if not.
*/Why this scored 16/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.