Skip to content

Commit 8d6f921

Browse files
committed
Merge bitcoin/bitcoin#24401: wallet: Add external-signer-support specific error message
7f3a6a9 wallet: Add external-signer-support specific error message (Hennadii Stepanov) Pull request description: On master (5f44c5c) an attempt to load an external signer wallet using Bitcoin Core compiled without external signer support fails with the following log messages: ``` 2022-02-20T19:01:11Z [qt-walletctrl] Using SQLite Version 3.31.1 2022-02-20T19:01:11Z [qt-walletctrl] Using wallet /home/hebasto/.bitcoin/testnet3/wallets/coldcard-0220 2022-02-20T19:01:11Z [qt-walletctrl] init message: Loading wallet… 2022-02-20T19:01:11Z [qt-walletctrl] [coldcard-0220] Error: External signer wallet being loaded without external signer support compiled 2022-02-20T19:01:11Z [qt-walletctrl] [coldcard-0220] Releasing wallet ``` While log messages are good, a message in the GUI window is completely misleading: ![Screenshot from 2022-02-20 20-43-46](https://user-images.githubusercontent.com/32963518/154859854-b87032e0-c428-4e11-8009-39e38200482c.png) This PR fixes this issue: ![Screenshot from 2022-02-20 21-01-18](https://user-images.githubusercontent.com/32963518/154859868-e3a2c89d-4f0f-424e-96cb-7accaa48acc0.png) ACKs for top commit: achow101: ACK 7f3a6a9 kristapsk: ACK 7f3a6a9 brunoerg: crACK 7f3a6a9 Tree-SHA512: a4842751c0ca8a37ccc3ea00503678f6b712a7f53d6cbdc07ce02dcb85ca8a94890d1c2da20307be043faa347747abeba29185c88ba12edd5253bfca56531585
2 parents 0a76bf8 + 7f3a6a9 commit 8d6f921

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,6 +2693,10 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
26932693
error = strprintf(_("Error loading %s: Wallet requires newer version of %s"), walletFile, PACKAGE_NAME);
26942694
return nullptr;
26952695
}
2696+
else if (nLoadWalletRet == DBErrors::EXTERNAL_SIGNER_SUPPORT_REQUIRED) {
2697+
error = strprintf(_("Error loading %s: External signer wallet being loaded without external signer support compiled"), walletFile);
2698+
return nullptr;
2699+
}
26962700
else if (nLoadWalletRet == DBErrors::NEED_REWRITE)
26972701
{
26982702
error = strprintf(_("Wallet needed to be rewritten: restart %s to complete"), PACKAGE_NAME);

src/wallet/walletdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
788788
#ifndef ENABLE_EXTERNAL_SIGNER
789789
if (pwallet->IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)) {
790790
pwallet->WalletLogPrintf("Error: External signer wallet being loaded without external signer support compiled\n");
791-
return DBErrors::TOO_NEW;
791+
return DBErrors::EXTERNAL_SIGNER_SUPPORT_REQUIRED;
792792
}
793793
#endif
794794

src/wallet/walletdb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum class DBErrors
4848
CORRUPT,
4949
NONCRITICAL_ERROR,
5050
TOO_NEW,
51+
EXTERNAL_SIGNER_SUPPORT_REQUIRED,
5152
LOAD_FAIL,
5253
NEED_REWRITE,
5354
NEED_RESCAN

0 commit comments

Comments
 (0)