-
Notifications
You must be signed in to change notification settings - Fork 38.6k
RPC refactoring: Access wallet using new GetWalletForJSONRPCRequest #8775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I don't like the coupling and the I think we should pack the request path (URI) into the Instead of the |
|
General ConceptACK on a |
src/rpc/misc.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*&?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, pwallet is an alias to reqinfo.wallet which is of type CWallet*.
That sounds nice, but greatly complicates the implementation. :( |
7697a0e to
df2c0c5
Compare
|
I think this can be closed after #8788? |
|
Closing in favor of merged #8788 |
Wrapped in CRPCRequestInfo to avoid gratuitous #ifdef ENABLE_WALLET everywhere Github-Pull: bitcoin#8775 Rebased-From: 80f4ab7b5f404d20bed41ec70182e6fc0990205b
Github-Pull: bitcoin#8775 Rebased-From: 9279b515815e58df5bd796b0570e388ff42fb84b
…nique per CWallet Github-Pull: bitcoin#8775 Rebased-From: 041f4e06a664b7e31ba77bbfbb2f7bc8d04174ca
06bd5d0 to
ab5ce98
Compare
|
Rebased and refactored based on @jonasschnelli 's idea. |
|
Makes sense, utACK ab5ce98 |
src/rpc/misc.cpp
Outdated
|
|
||
| using namespace std; | ||
|
|
||
| CWallet *GetWalletForJSONRPCRequest(const JSONRPCRequest&); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how this can pass the build w/ --disable-wallet, but this should be bracketed with #ifdef ENABLE_WALLET
5cce71a to
d6bc295
Compare
|
Rebased and addressed nit |
d6bc295 to
7de5573
Compare
Github-Pull: bitcoin#8775 Similar-To: 7de55733c5690350c48ec94660b5be56fbb5eb39
|
utACK 7de55733c5690350c48ec94660b5be56fbb5eb39 |
7de5573 to
7c65786
Compare
…tForJSONRPCRequest d678771 Wallet: Sanitise -wallet parameter (Luke Dashjr) 9756be3 Wallet/RPC: Use filename rather than CWallet pointer, for lockwallet RPCRunLater job name (Luke Dashjr) 86be48a More tightly couple EnsureWalletIsAvailable with GetWalletForJSONRPCRequest where appropriate (Luke Dashjr) a435632 Move wallet RPC declarations to rpcwallet.h (Luke Dashjr) ad15734 RPC: Pass on JSONRPCRequest metadata (URI/user/etc) for "help" method (Luke Dashjr) bf8a04a Reformat touched lines with C++11 (Luke Dashjr) 2e518e3 Move nWalletUnlockTime to CWallet::nRelockTime, and name timed task unique per CWallet (Luke Dashjr) d77ad6d RPC: Do all wallet access through new GetWalletForJSONRPCRequest (Luke Dashjr) eca550f RPC/Wallet: Pass CWallet as pointer to helper functions (Luke Dashjr) Tree-SHA512: bfd592da841693390e16f83b451503eb5cedb71208089aa32b3fc45e973555584a3ed7696dd239f6409324464d565dacf0f3d0e36e8e13ae6a7843848465f960
|
Hello @luke-jr , Is there any way where we can increase the number of wallets to be in loaded state at same time.As rightnow its like if I load wallet more than 100 or 150 daemon is getting crashed/stopped. I am trying to load/unload wallet dynamically using RPC. What i tried is incraesing the Reflink for above setup : https://docs.oracle.com/cd/E17276_01/html/api_reference/C/set_lk_max_lockers_parameter.html So is there any way or configuration or any changes which can increase and allow more number of wallets to be loaded ? |
4734a84 [Cleanup][Tests] Fix chainparams-change in librust tests (random-zebra) ff4cee0 [Trivial] Add wallet filename to backup errors/warning (random-zebra) dc596f3 [Doc] Add multiwallet section to release notes (random-zebra) 36796f2 [Cleanup] Fix formatting in wallet and walletdb (random-zebra) b6dbbf3 wallet: Forbid -salvagewallet, -zapwallettxes, and -upgradewallet with multiple wallets (random-zebra) 60f9b4b wallet: Base backup filenames on original wallet filename (Luke Dashjr) e6efa6b wallet: Include actual backup filename in recovery warning message (Luke Dashjr) 647fbc9 Wallet: Move multiwallet sanity checks to CWallet::Verify, and do other checks on all wallets (Luke Dashjr) b27dcfe Wallet: Support loading multiple wallets if -wallet used more than once (Luke Dashjr) d10acd5 [Tests] move pwalletMain to wallet test fixture + use smart pointer (random-zebra) d6cf608 [Refactor] Remove CWalletDBWrapper::GetUpdateCounter() (random-zebra) 4bbad5c [Wallet] Replace pwalletMain with a vector of wallet pointers (random-zebra) 100d67c Wallet: Sanitise -wallet parameter (Luke Dashjr) 3bfa7d8 Wallet/RPC: Use filename rather than CWallet pointer, for lockwallet RPCRunLater job name (Luke Dashjr) ca6a62d [MOVE-ONLY] Move wallet RPC declarations to rpcwallet.h (random-zebra) 687c2fd RPC: Pass on JSONRPCRequest metadata (URI/user/etc) for "help" method (Luke Dashjr) cc965fe Move nWalletUnlockTime to CWallet::nRelockTime, and name timed task unique per CWallet (Luke Dashjr) 22f8507 [Trivial] Rename pwalletMain --> pwallet for local variables in RPC (random-zebra) 325baaa RPC: Do all wallet access through new GetWalletForJSONRPCRequest (random-zebra) 0e21e09 [Cleanup] Remove un-used printAddresses() function in rpcwallet (random-zebra) a8dd236 RPC/Wallet: Pass CWallet as pointer to helper functions (random-zebra) fb64bbc [Doc] Remove ThreadFlushWalletDB from developer notes (random-zebra) dc2e022 [Refactor] fix WalletTestingSetup fixture (random-zebra) f9d7fe1 refactor: move bdb (bitdb) interaction from init.cpp to wallet.cpp (random-zebra) 9cfb711 CWalletDB: Store the update counter per wallet (Luke Dashjr) 8edb74f Bug: increment counter when writing minversion (random-zebra) 8aa93b9 Bugfix: wallet: Increment "update counter" only after actually making the applicable db changes to avoid potential races (Luke Dashjr) Pull request description: Quite a bit of refactoring to bring us a little closer to upstream in the wallet/walletdb area, introducing basic support for multiple wallets. The PIVX client can now be started with more than one `-wallet` argument (either as startup flags, or as multiple lines in pivx.conf). The wallets will be all loaded and kept separated, with individual balances, keys and received transactions. Even though only the first wallet will be used in the GUI/RPC for the moment (selectable wallets will be added later), all other loaded wallets will remain synchronized to the node's current tip and update their internal data. Bulk of changes coming from: - bitcoin#8775 RPC refactoring: Access wallet using new GetWalletForJSONRPCRequest - bitcoin#8694 Basic multiwallet support - bitcoin#11713 Fix for mismatched extern definition in wallet tests - bitcoin#11781 tests: move pwalletMain to wallet test fixture ACKs for top commit: furszy: Code ACK 4734a84 after rebase and inclusion of 4734a84. Tree-SHA512: 483fc34310c86070ffde08487605b25da957e55fbc8ef1b9cc1f682c6af0789619bb40839e915618d603097a1bdcf6b2110c7fabf017f8351b3a426976ca77a9
Part of the refactorings needed for basic multiwallet (#8694)