HomePhabricator

Deduplicate some block-to-JSON code.

Description

Deduplicate some block-to-JSON code.

Summary:
Some of the logic converting blocks and block headers to JSON for
the blockchain RPC methods (getblock, getlockheader) was duplicated.
Instead of that, the blockToJSON RPC method now calls blockheaderToJSON
first, and then fills in the missing, block-specific bits explicitly.

This is a backport of core#21114

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11335

Details

Provenance
Daniel Kraft <d@domob.eu>Authored on Feb 8 2021, 11:57
PiRKCommitted on Apr 13 2022, 18:18
PiRKPushed on Apr 13 2022, 18:18
Reviewer
Restricted Project
Differential Revision
D11335: Deduplicate some block-to-JSON code.
Parents
rABC31a72674cb7b: [Cashtab] Rename contacts
Branches
Unknown
Tags
Unknown