HomePhabricator

rpc: Tidy up local references (see commit message)

Description

rpc: Tidy up local references (see commit message)

Summary:
Organize local variables/references such that:

  1. There is always a ChainstateManager reference before any LOCK(cs_main).
  2. NodeContext references are used with Ensure*() functions introduced in previous commit where appropriate to avoid duplicate assertions.

This is a backport of core#21391 [12/14]
https://github.com/bitcoin/bitcoin/pull/21391/commits/6a3d1920209cded0dae52fb9070a3530d9a4e5fd

Depends on D11586

Test Plan:
With clang and debug:
ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Apr 12 2021, 22:41
PiRKCommitted on Jun 9 2022, 16:19
PiRKPushed on Jun 9 2022, 16:19
Reviewer
Restricted Project
Differential Revision
D11587: rpc: Tidy up local references (see commit message)
Parents
rABC041fad036e3e: rpc: refactor Ensure* functions
Branches
Unknown
Tags
Unknown