laanwj added the label
RPC/REST/ZMQ
on Mar 29, 2016
laanwj force-pushed
on Mar 29, 2016
laanwj added the label
Refactoring
on Mar 29, 2016
jonasschnelli
commented at 6:15 pm on March 29, 2016:
contributor
Nice!
Concept ACK.
MarcoFalke
commented at 6:18 pm on March 29, 2016:
member
Concept ACK. Would it make sense to get rid of the duplicate code in void Register*()?
laanwj
commented at 7:10 am on March 30, 2016:
member
Would it make sense to get rid of the duplicate code in void Register*()?
Maybe. I thought about it, but it’s only a simple loop of four lines, sometimes factoring something so simple out to a function makes things harder to understand, not easier.
Another option would be to export a ‘descriptor structure’ with a name, pointer to the array, and size of the array. E.g. like Linux modules.
But simply having Register* function leaves it up to the module as to how to determine what to register (e.g. there may be optional features enabled on the command line).
jonasschnelli
commented at 9:30 am on March 30, 2016:
contributor
IMO we should keep the array loop as it is (and not refactor with some hard-to-understand macro-like optimization).
laanwj
commented at 10:07 am on March 30, 2016:
member
Could make it two lines, even, without losing any clarity:
0 for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
1 tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]);
(will update the one in rpcwallet as well)
CodeShark
commented at 10:51 am on March 30, 2016:
contributor
Concept ACK
sipa
commented at 11:47 am on March 30, 2016:
member
Concept ACK, though I wonder if it wouldn’t be cleaner to pass a pointer to tableRPC to the registration commands, so the individual RPC implementations don’t even need to depend on access to the global?
laanwj
commented at 11:58 am on March 30, 2016:
member
pass a pointer to tableRPC to the registration commands
Awesome idea, will do that.
sipa
commented at 3:56 pm on March 30, 2016:
member
utACK3be52e1
dcousens
commented at 1:00 am on March 31, 2016:
contributor
utACK3be52e1
rpc: Register calls where they are defined
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.
fb8a8cf2e6
laanwj
commented at 8:48 am on March 31, 2016:
member
Squashed a20fca9 0b18725 dcb0a76 3be52e1 into fb8a8cf
laanwj force-pushed
on Mar 31, 2016
laanwj merged this
on Mar 31, 2016
laanwj closed this
on Mar 31, 2016
laanwj referenced this in commit
16555b658f
on Mar 31, 2016
codablock referenced this in commit
9c83fd9148
on Sep 16, 2017
codablock referenced this in commit
37c2e89ec0
on Sep 19, 2017
codablock referenced this in commit
dd9779241a
on Dec 9, 2017
codablock referenced this in commit
0265716e4e
on Dec 19, 2017
codablock referenced this in commit
644240157a
on Dec 19, 2017
zkbot referenced this in commit
52f4abccef
on Jun 20, 2018
zkbot referenced this in commit
ec246b2ec1
on Jul 3, 2018
zkbot referenced this in commit
b8e82e77af
on Jul 16, 2018
zkbot referenced this in commit
5978dfecb5
on Jul 18, 2018
zkbot referenced this in commit
cd0484e023
on Jul 18, 2018
random-zebra referenced this in commit
7a849ca06a
on Jul 1, 2020
random-zebra referenced this in commit
ab460a523f
on Oct 30, 2020
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 15:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me