-
Notifications
You must be signed in to change notification settings - Fork 588
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
calling wallet.Stop() at application exit results in an error #282
Comments
This is due to bolt transactions still being active while the database is closed. I will look into adding a mutex in walletdb to prevent this from happening. |
Actually, this could be a different issue. The MMIO issues caused by closing the db with active transactions will result in the process segfaulting, but this appears to be a panic from a nil pointer dereference (which the language enforces null pointer checks on before dereferencing, so there can never be a segfault). |
This corrects and simplifies the shutdown logic for interrupts, the walletrpc.WalletLoaderService/CloseWallet RPC, and the legacy stop RPC by both stopping all wallet processes and closing the wallet database. It appears that this behavior broke as part of the wallet package refactor, causing occasional nil pointer panics and memory faults when closing the wallet database with active transactions. Fixes btcsuite#282. Fixes btcsuite#283.
This corrects and simplifies the shutdown logic for interrupts, the walletrpc.WalletLoaderService/CloseWallet RPC, and the legacy stop RPC by both stopping all wallet processes and closing the wallet database. It appears that this behavior broke as part of the wallet package refactor, causing occasional nil pointer panics and memory faults when closing the wallet database with active transactions. Fixes btcsuite#282. Fixes btcsuite#283.
It doesn't happen 100% of the times, so probably a race condition somewhere.
The text was updated successfully, but these errors were encountered: