Page MenuHomePhabricator

[backport#16839] Avoid using g_rpc_node global in wallet code

Authored by majcosta on Jun 6 2020, 22:01.



Wallet code should use interfaces::Chain and not directly access to node state.

Add a g_rpc_chain replacement global for wallet code to use, and move
g_rpc_node definition to a libbitcoin_server source file so there are link
errors if wallet code tries to access it.

Depends on D6418

Concludes backport of Core PR16839

Test Plan
ninja check-all

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

majcosta requested review of this revision.Jun 6 2020, 22:01

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.Jun 6 2020, 22:27
deadalnix added a subscriber: deadalnix.

What about src/rpc/blockchain.h ?

501 ↗(On Diff #21005)

Why return? This does nothing, you can remove it.

3167 ↗(On Diff #21005)

This isn't in the original PR. Can you explain?

This revision now requires changes to proceed.Jun 6 2020, 22:27

rebased onto missing deps, addressed comments

This revision is now accepted and ready to land.Jun 7 2020, 01:07