-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpc: Move the generate RPC call to rpcwallet
#10683
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
1e09f2c to
8c410a8
Compare
jnewbery
left a comment
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.
tested ACK 8c410a8fbb5f1876484a3f10d25cf9c06a8ef875. This is a sensible change. Anything that moves us towards #7965 and away from circular libbitcoin_server.a/libbitcoin_wallet.a dependencies is a good thing in my book.
I realise that this is mostly code-move. There are a bunch of style nits in the moved code - entirely up to you if you want to address them as part of this PR or leave them as they are.
src/wallet/rpcwallet.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.
nit: braces
src/wallet/rpcwallet.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.
nit: braces
src/wallet/rpcwallet.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.
nit: variable name should be lowercase, not hungarian
src/wallet/rpcwallet.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.
nit: variable name should be lowercase, not hungarian
src/wallet/rpcwallet.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.
nit: should handle case when request.params[1] is Null (for named arguments)
src/wallet/rpcwallet.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.
nit: braces
src/wallet/rpcwallet.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.
nit: braces
|
utACK 8c410a8 though nit cleanup is great too. |
|
Nice and thanks for doing this: |
|
Ok ok I'll add a commit to clean up the style nits, don't think it should be done at the time of the move as that just complicates review. |
3b75faf to
4cdb620
Compare
|
utACK 4cdb6209de2f712cd5847373b6bc2fb6401fb739. No more nits. Thanks!
I'd agree if the nit fixes were in the same commit, but if they're done in their own commit either before or after the move it adds almost no review burden (as long as reviewers are reviewing commitwise) |
Yes that's what I meant, with a separate commit it's fine. |
TheBlueMatt
left a comment
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.
utACK 4cdb6209de2f712cd5847373b6bc2fb6401fb739, thanks for cleaning up CValidationInterface.
src/rpc/mining.h
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.
Shouldnt this be a "-style include?
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, good point
This makes it possible to mine to any wallet when multi-wallet mode is added. Solves the same problem as bitcoin#10649, but IMO in a cleaner way. It also gets rid of the circuitous `ScriptForMining` method on `CValidationInterface`, which really doesn't belong there. After this change it's still possible to mine without wallet through `generatetoaddress`.
Fix nits by John Newbery.
4cdb620 to
2a96283
Compare
2a96283 rpc: Update `generate` for developer notes (Wladimir J. van der Laan) df7e2f0 rpc: Move the `generate` RPC call to rpcwallet (Wladimir J. van der Laan) Tree-SHA512: ec658d6178f8435dc54b9d9c6dd59f873055a8ae0c3f177c02049d77b93107dd5fc17a1ff56d50f051810d52fdf306846eaba2ef4fc8d2a6cfa831f57a1045c4
2a96283 rpc: Update `generate` for developer notes (Wladimir J. van der Laan) df7e2f0 rpc: Move the `generate` RPC call to rpcwallet (Wladimir J. van der Laan) Tree-SHA512: ec658d6178f8435dc54b9d9c6dd59f873055a8ae0c3f177c02049d77b93107dd5fc17a1ff56d50f051810d52fdf306846eaba2ef4fc8d2a6cfa831f57a1045c4
This makes it possible to mine to any wallet when multi-wallet mode is added. Solves the same problem as #10649, but IMO in a cleaner way.
It also gets rid of the circuitous
ScriptForMiningmethod onCValidationInterface, which really doesn't belong there.After this change it's still possible to mine without wallet through
generatetoaddress. I first proposed this in #7965.