-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Interaction cleanups between main and wallet #3115
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
ACK concept, and code looks good to me. Needs at least a sketch of a test plan that exercises all of the signals. |
{ | ||
if (!fFileBacked) | ||
return false; |
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.
By declaring the signals as void, we do lose error reporting from the wallets. Not sure this is a big loss, but in case we'd like to keep this, boost::signals2 has various ways of combining the results from the handlers.
Haven't tested yet, but code lookg good and I like the approach. |
@laanwj The reasoning is that there are callbacks from the node/validation to the wallet; they're really just notifications in general, as the node code shouldn't care about what the wallet does with it (in fact, the signal names shouldn't contain "wallet" even, though I chose not to change them here). As EraseFromWallet was only called as a callback, I just simplified the method here. In the case of AddToWalletIfInvolvingMe (which is called internally inside the wallet as well, with a relevant return code), I added a wrapper to use as signal handler. |
Ok, thanks, that makes it clear, I was just not sure if it was overlooked or on purpose. I like the idea of renaming the signals to be more general (so that theoretically non-wallets could also use the API to keep track)
|
@laanwj Modified the signal names a bit, and added comments. |
This required some code movement (what was CWalletTx::AcceptToMemoryPool doing in main?), and adding a few explicit includes that used to be implicit through init.h.
Rebased. |
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/722fa283d04dfe9c70418e69535a08eea06b4377 for binaries and test log. |
@gavinandresen Test plan:
|
ACK. Ran through test plan with a Bitcoin-Qt in regtest mode and two -regtest bitcoind's, all tests passed. |
Interaction cleanups between main and wallet
* Add Alpine packages to UNIX build doc * Add Alpine packages required for building GUI
This pull request converts the custom callback handling (from main to wallet) to using boost::signals2, which allow concurrent modification/execution, and are thread-safe. To implement callbacks, a new CWalletInterface is defined in main, and implemented by wallet. As a result, together with a few more changes, we can break the dependency from init (and indirectly, from main) on wallet.
Two functional cleanups were included as well, namely removing the behaviour where transactions "fFromMe" were always trickled (we shouldn't treat our own transactions differently, privacy leak) and removing the (apparently since-long broken) PrintWallets functionality.
Closes #2965.