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 559 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
- HD Wallet vs Descriptor Wallet: What's the Deal? 3
- New Wallet Regulations for Crypto Purchases Over $10K in the US 15
- Creating a Brain Wallet Generator with Bash 15
- Major Bitcoin Wallets Gain Confidence as BTC Surges 20
- Need help migrating my old wallet.dat to the latest version 4