[RPC, Wallet] Move RPC dispatch table registration to wallet/ code #7307

pull jonasschnelli wants to merge 1 commits into bitcoin:master from bitcoin:2016/01/corewallet changing 8 files +106 −93
  1. jonasschnelli commented at 7:39 am on January 7, 2016: contributor

    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:

    • wallet/core code seperation
    • better interface for integrating another wallet
  2. jonasschnelli added the label Wallet on Jan 7, 2016
  3. jonasschnelli added the label RPC on Jan 7, 2016
  4. jonasschnelli force-pushed on Jan 7, 2016
  5. laanwj commented at 11:30 am on January 7, 2016: member

    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:

    • walletRegisterRPCCommands should not be on CWallet. CWallet is the class that implements the wallet not its RPC interface. A better place is in rpcwallet.cpp.
    • walletRegisterRPCCommands implementation should not be in the header file, but in an implementation file
    • The contents (initialization) of const CRPCCommand vWalletRPCCommands[] belong in an implementation file, not a header file. Having a data structure initialization in a header file means it can only be included in one place, otherwise there will be duplicate definition errors.
  6. jonasschnelli force-pushed on Jan 7, 2016
  7. jonasschnelli commented at 12:20 pm on January 7, 2016: contributor

    Agreed with and fixed @laanwj points/nits.

    Having a data structure initialization in a header file means it can only be included in one place, otherwise there will be duplicate definition errors.

    Just curios: wouldn’t this be avoided because of the headers preprocessor marcos (like #ifndef BITCOIN_WALLET_RPCWALLET_H)

  8. paveljanik commented at 12:31 pm on January 7, 2016: contributor
    @jonasschnelli No. Think about including this file into two separately compiled source files. Compile works. Link phase fails.
  9. jonasschnelli force-pushed on Jan 7, 2016
  10. in src/wallet/rpcwallet.cpp: in b87edf9efc outdated
    77+};
    78+
    79+void walletRegisterRPCCommands()
    80+{
    81+    unsigned int vcidx;
    82+    for (vcidx = 0; vcidx < (sizeof(vWalletRPCCommands) / sizeof(vWalletRPCCommands[0])); vcidx++)
    


    jgarzik commented at 2:32 pm on January 7, 2016:
    Use ARRAYLEN() macro.
  11. jgarzik commented at 2:34 pm on January 7, 2016: contributor

    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.

  12. jonasschnelli force-pushed on Jan 7, 2016
  13. jonasschnelli commented at 7:55 pm on January 7, 2016: contributor
    @jgarzik: Your totally right. Removed the function definitions in rpcwallet.h, kept some (functions of rpcdump.cpp) in rpcwallet.cpp.
  14. jonasschnelli force-pushed on Jan 15, 2016
  15. jonasschnelli commented at 10:06 am on January 15, 2016: contributor
    Rebased. Would be nice to get some ACKs or NACKs because this PR tend to get merge conflicts very quick.
  16. MarcoFalke commented at 4:51 pm on January 15, 2016: member
    Concept ACK
  17. [RPC, Wallet] Move RPC dispatch table registration to wallet/ code
    Allow extending the rpc dispatch table by appending commands when server is not running.
    dd2dc400ee
  18. jonasschnelli force-pushed on Jan 20, 2016
  19. laanwj merged this on Jan 20, 2016
  20. laanwj closed this on Jan 20, 2016

  21. laanwj referenced this in commit 9982710e88 on Jan 20, 2016
  22. laanwj commented at 2:31 pm on January 20, 2016: member
    utACK
  23. jonasschnelli deleted the branch on Jan 21, 2016
  24. laanwj referenced this in commit e1cf8470c3 on Mar 29, 2016
  25. laanwj referenced this in commit a20fca97bc on Mar 29, 2016
  26. laanwj referenced this in commit fb8a8cf2e6 on Mar 31, 2016
  27. makevoid referenced this in commit 9e23006216 on Jun 13, 2016
  28. deadalnix referenced this in commit b0ccd77de9 on Jan 4, 2017
  29. deadalnix referenced this in commit 200bfdfcaf on Jan 5, 2017
  30. deadalnix referenced this in commit 1f2d5d0cf4 on Jan 5, 2017
  31. deadalnix referenced this in commit 245e0d6ca6 on Jan 6, 2017
  32. deadalnix referenced this in commit c1db420ecb on Jan 8, 2017
  33. deadalnix referenced this in commit de395f2132 on Jan 10, 2017
  34. deadalnix referenced this in commit 6a7b395ce3 on Jan 11, 2017
  35. deadalnix referenced this in commit 0c933ab944 on Jan 15, 2017
  36. deadalnix referenced this in commit f4df0701c1 on Jan 16, 2017
  37. deadalnix referenced this in commit a966c200a1 on Jan 17, 2017
  38. deadalnix referenced this in commit 9b956f1db8 on Jan 19, 2017
  39. deadalnix referenced this in commit aff309321c on Jan 19, 2017
  40. deadalnix referenced this in commit 3b21f2517b on Jan 19, 2017
  41. deadalnix referenced this in commit 548d4e4001 on Jan 19, 2017
  42. deadalnix referenced this in commit debfc7b496 on Jan 19, 2017
  43. deadalnix referenced this in commit 14f09c4ae5 on Jan 26, 2017
  44. deadalnix referenced this in commit d3b1f0f61b on Feb 12, 2017
  45. sickpig referenced this in commit f69baee6bf on Feb 20, 2017
  46. codablock referenced this in commit 7854f2ba82 on Sep 16, 2017
  47. codablock referenced this in commit e9e105201e on Sep 19, 2017
  48. codablock referenced this in commit a7692bbfa9 on Dec 9, 2017
  49. codablock referenced this in commit 19e423b095 on Dec 9, 2017
  50. codablock referenced this in commit 78ad32d105 on Dec 9, 2017
  51. codablock referenced this in commit 9361c0a361 on Dec 9, 2017
  52. codablock referenced this in commit 51ca0d5b47 on Dec 11, 2017
  53. zkbot referenced this in commit 52f4abccef on Jun 20, 2018
  54. zkbot referenced this in commit ec246b2ec1 on Jul 3, 2018
  55. zkbot referenced this in commit b8e82e77af on Jul 16, 2018
  56. zkbot referenced this in commit 5978dfecb5 on Jul 18, 2018
  57. zkbot referenced this in commit cd0484e023 on Jul 18, 2018
  58. random-zebra referenced this in commit 7a849ca06a on Jul 1, 2020
  59. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-22 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me