rpc, net: completely remove `startingheight` field of `getpeerinfo` RPC
What changed, and why it matters
This commit removes an old, optional field called 'startingheight' from the 'getpeerinfo' command in Bitcoin Core. The field had already been marked as deprecated in a previous release and was only returned if a user explicitly enabled it. This is a routine cleanup, not a security fix.
No security action required. Reviewers may want to confirm downstream tools no longer rely on the removed field.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the ‘startingheight’ output key from the getpeerinfo RPC and removes the associated -deprecatedrpc=startingheight configuration option. It also updates the release notes and a functional test that exercised the deprecated field. No logic changes affect peer handling, consensus, networking, or wallet operations.
Changed components
src/rpc/net.cpptest/functional/rpc_net.pydoc/release-notes-34796.mdInspect captured patch +7 / −6
diff --git a/doc/release-notes-34796.md b/doc/release-notes-34796.md
new file mode 100644
index 00000000..a09786bf
--- /dev/null
+++ b/doc/release-notes-34796.md
@@ -0,0 +1,6 @@
+Updated RPCs
+------------
+
+- The `-deprecatedrpc=startingheight` configuration option has been removed.
+ The `getpeerinfo` RPC no longer returns the `startingheight` field, which
+ was previously deprecated in v31.0. (#34796)
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index 5c54e207..ea07c560 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -161,7 +161,6 @@ static RPCHelpMan getpeerinfo()
{RPCResult::Type::BOOL, "inbound", "Inbound (true) or Outbound (false)"},
{RPCResult::Type::BOOL, "bip152_hb_to", "Whether we selected peer as (compact blocks) high-bandwidth peer"},
{RPCResult::Type::BOOL, "bip152_hb_from", "Whether peer selected us as (compact blocks) high-bandwidth peer"},
- {RPCResult::Type::NUM, "startingheight", /*optional=*/true, "(DEPRECATED, returned only if config option -deprecatedrpc=startingheight is passed) The starting height (block) of the peer"},
{RPCResult::Type::NUM, "presynced_headers", "The current height of header pre-synchronization with this peer, or -1 if no low-work sync is in progress"},
{RPCResult::Type::NUM, "synced_headers", "The last header we have in common with this peer"},
{RPCResult::Type::NUM, "synced_blocks", "The last block we have in common with this peer"},
@@ -268,9 +267,6 @@ static RPCHelpMan getpeerinfo()
obj.pushKV("inbound", stats.fInbound);
obj.pushKV("bip152_hb_to", stats.m_bip152_highbandwidth_to);
obj.pushKV("bip152_hb_from", stats.m_bip152_highbandwidth_from);
- if (IsDeprecatedRPCEnabled("startingheight")) {
- obj.pushKV("startingheight", statestats.m_starting_height);
- }
obj.pushKV("presynced_headers", statestats.presync_height);
obj.pushKV("synced_headers", statestats.nSyncHeight);
obj.pushKV("synced_blocks", statestats.nCommonHeight);
diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py
index 30e0d536..24769e2b 100755
--- a/test/functional/rpc_net.py
+++ b/test/functional/rpc_net.py
@@ -63,7 +63,7 @@ class NetTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [
- ["-minrelaytxfee=0.00001000", "-deprecatedrpc=startingheight"],
+ ["-minrelaytxfee=0.00001000"],
["-minrelaytxfee=0.00000500"],
]
# Specify a non-working proxy to make sure no actual connections to public IPs are attempted
@@ -174,7 +174,6 @@ class NetTest(BitcoinTestFramework):
"services": "0000000000000000",
"servicesnames": [],
"session_id": "" if not self.options.v2transport else no_version_peer.v2_state.peer['session_id'].hex(),
- "startingheight": -1,
"subver": "",
"synced_blocks": -1,
"synced_headers": -1,
Why this scored 20/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.