Review report

bitcoin/bitcoin: PR #36642

1 suggestion

Optional improvements

Link

[suggestion] · PR description describes a parse() reset that the patch no longer makes

The description attributes the fix to resets in parse(), but the patch isolates batch elements with separate request copies.

Location: src/httprpc.cpp:163 (head).

Details and suggested fix

The description says “I reset both fields at the top of parse()”, but JSONRPCRequest::parse() is unchanged: it still rejects a non-object before assigning id or m_json_version. The fix instead creates JSONRPCRequest elem_jreq{jreq} for each batch element and uses that copy for parsing, error replies, and the notification check. This isolates state in the batch loop rather than changing the contract of parse(). Update the description to say that each batch element is parsed into its own copy of the unparsed request, matching the commit message. This is a description correction, not a runtime defect.


Coverage details