Page MenuHomePhabricator

Merge #11027: [RPC] Only return hex field once in getrawtransaction

Authored by jasonbcox on Mar 19 2019, 17:08.



6bbdafc Pass serialization flags and whether to include hex to TxToUniv (Andrew Chow)
e029c6e Only return hex field once in getrawtransaction (Andrew Chow)

Pull request description:

The hex is already returned in `TxToUniv()`, no need to give it out a second time in getrawtransaction itself.

Tree-SHA512: 270289f2d6dea37f51f5a42db3dae5debdbe83c6b504fccfd3391588da986ed474592c6655d522dc51022d4b08fa90ed1ebb249afe036309f95adfe3652cb262

Backport of Core PR 11027
Completes T564

Test Plan

ninja check

Run bitcoin-cli <txid> 1 and ensure that there is a single top-level "hex" field in the returned JSON.

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jasonbcox created this revision.Mar 19 2019, 17:08
Herald added a reviewer: Restricted Project. · View Herald TranscriptMar 19 2019, 17:09
Herald added a subscriber: schancel. · View Herald Transcript
Fabien added a comment.Mar 20 2019, 12:20

Note to reviewers:
If you try to reproduce the described problem, you will not be able to do so.
This is because this fixes is against an older version of univalue. Our current version will prevent inserting the same key twice, thus masking the duplicated entry.
You can find the library update commit and the diff between the versions here search for pushKV in univalue.cpp.

Note 2 : even if there is no issue to fix, this diff impacts the output by moving the "hex" field from the beginning to the near end of the JSON. This should have no impact if proper JSON decoding is used.

Fabien accepted this revision.Mar 20 2019, 12:24
Fabien edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Mar 20 2019, 12:25
This revision was automatically updated to reflect the committed changes.