[RPC, Wallet] Move RPC dispatch table registration to wallet/ code#7307
[RPC, Wallet] Move RPC dispatch table registration to wallet/ code#7307
Conversation
9d56914 to
e1409e8
Compare
|
Concept ACK. It's good that 'modules' can register their own RPC calls. The wallet is a prime example of this, but there may be more in the future. Some nits:
|
ee34681 to
7aafd60
Compare
|
Agreed with and fixed @laanwj points/nits.
Just curios: wouldn't this be avoided because of the headers preprocessor marcos (like |
|
@jonasschnelli No. Think about including this file into two separately compiled source files. Compile works. Link phase fails. |
7aafd60 to
b87edf9
Compare
src/wallet/rpcwallet.cpp
Outdated
|
ut ACK Note - The need to define functions in rpcwallet.h is greatly diminished. The rpcwallet.cpp externs could be removed from rpcwallet.h right now. The only reference is the in-rpcwallet call table. |
5e6c28e to
160b237
Compare
|
@jgarzik: Your totally right. Removed the function definitions in |
160b237 to
23b583a
Compare
|
Rebased. |
|
Concept ACK |
Allow extending the rpc dispatch table by appending commands when server is not running.
23b583a to
dd2dc40
Compare
…llet/ code dd2dc40 [RPC, Wallet] Move RPC dispatch table registration to wallet/ code (Jonas Schnelli)
|
utACK |
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.
- This makes it easier to add or remove RPC commands - no longer everything that includes
rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.
Continues bitcoin#7307 for the non-wallet.
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.
- This makes it easier to add or remove RPC commands - no longer everything that includes
rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.
Continues bitcoin#7307 for the non-wallet.
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.
- This makes it easier to add or remove RPC commands - no longer everything that includes
rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.
Continues bitcoin#7307 for the non-wallet.
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.
- This makes it easier to add or remove RPC commands - no longer everything that includes
rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.
Continues #7307 for the non-wallet.
…n to wallet/ code dd2dc40 [RPC, Wallet] Move RPC dispatch table registration to wallet/ code (Jonas Schnelli)
…was backported Allows to compile with no wallet again.
RPC code refactor Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7307 - bitcoin/bitcoin#7348 - bitcoin/bitcoin#7766
RPC code refactor Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7307 - bitcoin/bitcoin#7348 - bitcoin/bitcoin#7766
RPC code refactor Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7307 - bitcoin/bitcoin#7348 - bitcoin/bitcoin#7766
9f4868a [move] move listunspent to wallet/rpcwallet.cpp (furszy) e85e4f1 [RPC] Move RPC dispatch table registration to rpcwallet code (furszy) c0bc348 [RPC] push down reqWallet [first step] (furszy) cdb80a6 [RPC] Remove not used threadsafe in CRPCCommand (furszy) Pull request description: Initial work over the RPC dispatch table registration update. Includes the following changes: 1) Remove the unused threadSafe member from every CPRCCommand. (bitcoin#5711 , second commit) 2) Remove reqWallet from every CPRCCommand (bitcoin#5992 , second commit partially). 3) Move most of the wallet RPC commands registration to the rpcwallet file (bitcoin#7307 without the `EnsureWalletIsAvailable` on every RPC call --> mainly because the wallet RPC commands will only be registered if the wallet is available). to do: Move the remaining commands that were not moved from server to rpcwallet. ---------- Next step would be bitcoin#7766 (If anyone want to tackle it, feel more than welcome to tackle it). ACKs for top commit: Fuzzbawls: ACK 9f4868a random-zebra: All good. ACK 9f4868a and merging... Tree-SHA512: cd83cdc2de81efb5cb84d39753a160b19d8ca2967a1b303d85c3279559b478352c5a4316942c7a654e9c667b5a8f5bfa18020c1b6c9e78f4c408028840d0fc86
Another try...
Move all wallet RPC commands definitions and dispatch entries to
wallet/wallet_rpcdispatch.h.Allow extending the RPC dispatch table by appending commands when server is not running.
Motivation: