Merge bitcoin/bitcoin#36415: rpc: clarify preciousblock help text
What changed, and why it matters
This change only updates the help text shown by the preciousblock RPC command to explain more clearly when it has no effect and that it does not permanently lock the chain. No code behavior was changed.
No security action needed; this is a documentation-only clarification.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds three sentences to the preciousblock RPC help string in src/rpc/blockchain.cpp. It clarifies that the command only breaks ties between equal-work chains, has no effect if the specified block has less work than the current tip (including ancestors of the tip), and does not prevent the node from switching to a later higher-work chain. The commit message explicitly states ‘doesn’t change any behavior.’
Changed components
src/rpc/blockchain.cppInspect captured patch +3 / −0
### src/rpc/blockchain.cpp
@@ -1713,6 +1713,9 @@ static RPCMethod preciousblock()
return RPCMethod{
"preciousblock",
"Treats a block as if it were received before others with the same work.\n"
+ "\nThis only breaks ties between chains with equal work. If the specified block has the same work as the current tip, "
+ "the node switches its active chain to it. If the specified block has less work than the current tip (including any "
+ "ancestor of the tip), the call has no effect. If another chain later gains more work, the node switches to it as usual.\n"
"\nA later preciousblock call can override the effect of an earlier one.\n"
"\nThe effects of preciousblock are not retained across restarts.\n",
{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.