Page MenuHomePhabricator

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

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

Details

Summary

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.

https://github.com/bitcoin/bitcoin/pull/16839/commits/362ded410b8cb1104b7ef31ff8488fec4824a7d5


Depends on D6418

Concludes backport of Core PR16839

Test Plan
ninja check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
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 ?

src/interfaces/wallet.cpp
501 ↗(On Diff #21005)

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

src/wallet/rpcwallet.cpp
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