hey, check out line 103 in src/bitcoin-wallet.cpp in the latest branch:
std::unique_ptr<interfaces::Init> init = interfaces::MakeWalletInit(argc, argv, exit_status);
if (!init) {
return exit_status;
}
this seems to deal with wallet initialization but I can't find any real details on interfaces::MakeWalletInit, only this in src/init/bitcoin-wallet.cpp:
namespace interfaces {
std::unique_ptr<Init> MakeWalletInit(int argc, char* argv[], int& exit_status)
{
return std::make_unique<Init>();
}
} // namespace interfaces
but that just returns a root Init, like what gives?
Understanding the Bitcoin Wallet Code
2 replies 224 views
I think this ties into the process separation project. Might be worth checking out those GitHub links:
https://github.com/bitcoin/bitcoin/pull/23006 and https://github.com/orgs/bitcoin/projects/8/views/1.
Not sure if it's being utilized yet but could be. Someone who's more in the loop could clarify. If you're not familiar, the project has more info here:
https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Process-Separation
and here’s another link on multiprocess stuff: https://github.com/ryanofsky/bitcoin/blob/ipc-export/doc/multiprocess.md#next-steps.
if I remember right, MakeWalletInit is kinda dynamic. it changes based on how Bitcoin is compiled. like, if the wallet is enabled or not.
it’s not a strict function call, more of an interface that manages what’s needed from the wallet.
maybe this was done to keep Bitcoin scalable and adaptable for future upgrades? just a guess though.
Related topics
- Need Help Cracking My Bitcoin Wallet Password 19
- Setting Up a Bitcoin Wallet System for My Website 19
- New Open-Source Wallet for Bitcoin and Litecoin Testnets 3
- Need Help Recovering Old Bitcoin Wallet from 2009 19
- Understanding sigscript and witness in Bitcoin transactions 5
- How to Spend from an Offline Bitcoin Core Wallet? 19