For testing, I am using this:
0--- a/src/wallet/wallet.cpp
1+++ b/src/wallet/wallet.cpp
2@@ -2102,6 +2102,7 @@ OutputType CWallet::TransactionChangeType(const std::optional<OutputType>& chang
3 void CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::vector<std::pair<std::string, std::string>> orderForm)
4 {
5 LOCK(cs_wallet);
6+ throw std::runtime_error(std::string(__func__) + ": Wallet db error, transaction commit failed");
7 WalletLogPrintf("CommitTransaction:\n%s", tx->ToString()); /* Continued */
8
9 // Add tx to wallet, because if it has change it's also ours,
To trigger it, you have to attempt to send a transaction.
This correctly displays an error dialog, then exits with:
0************************
1EXCEPTION: St13runtime_error
2CommitTransaction: Wallet db error, transaction commit failed
3bitcoin in QPushButton->SendCoinsDialog
4
5bitcoin-qt: ./checkqueue.h:204: CCheckQueue<CScriptCheck>::~CCheckQueue() [T = CScriptCheck]: Assertion `m_worker_threads.empty()' failed.
6Aborted
This issue is related to the failed assertion during the unclean exit.