Page MenuHomePhabricator

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

Authored by majcosta on Sat, Jun 6, 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 created this revision.Sat, Jun 6, 22:01
Herald added a reviewer: Restricted Project. · View Herald TranscriptSat, Jun 6, 22:01
majcosta requested review of this revision.Sat, Jun 6, 22:01
teamcity edited the summary of this revision. (Show Details)Sat, Jun 6, 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.Sat, Jun 6, 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.Sat, Jun 6, 22:27
majcosta updated this revision to Diff 21017.Sun, Jun 7, 00:31

rebased onto missing deps, addressed comments

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