Skip to content

Conversation

@cmihai
Copy link
Member

@cmihai cmihai commented Apr 5, 2019

Bitcoin 0.17 now allows us to unload (and re-load) wallets. This clashed
with the CWalletExtension::ManagePendingSlashings, which was scheduled
to run periodically every 10 seconds, and which tried to access the
wallet, even though it could be unloaded by that moment.

This commit saves a reference to the wallet during the execution of the
task, to avoid a segfault. Further, it introduces a new type of benign
exception, task_unscheduled, which interrupts the execution of the
current task and does not reschedule it.

@cmihai cmihai requested a review from scravy April 5, 2019 15:12
@cmihai cmihai self-assigned this Apr 5, 2019
@cmihai cmihai added the bug A problem of existing functionality label Apr 5, 2019
@cmihai cmihai force-pushed the merge-bitcoin-0.17 branch from 0e33a92 to 266eb80 Compare April 5, 2019 16:18
Bitcoin 0.17 now allows us to unload (and re-load) wallets. This clashed
with the `CWalletExtension::ManagePendingSlashings`, which was scheduled
to run periodically every 10 seconds, and which tried to access the
wallet, even though it could be unloaded by that moment.

This commit saves a reference to the wallet during the execution of the
task, to avoid a segfault. Further, it introduces a new type of benign
exception, `task_unscheduled`, which interrupts the execution of the
current task and does not reschedule it.

Signed-off-by: Mihai Ciumeica <[email protected]>
@cmihai cmihai removed the request for review from scravy April 5, 2019 17:31
@cmihai cmihai merged commit 6fea609 into merge-bitcoin-0.17 Apr 5, 2019
@cmihai cmihai deleted the fix-segfault branch April 5, 2019 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A problem of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants