mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge bitcoin/bitcoin#24401: wallet: Add external-signer-support specific error message
7f3a6a9495wallet: Add external-signer-support specific error message (Hennadii Stepanov) Pull request description: On master (5f44c5c428) 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:  This PR fixes this issue:  ACKs for top commit: achow101: ACK7f3a6a9495kristapsk: ACK7f3a6a9495brunoerg: crACK7f3a6a9495Tree-SHA512: a4842751c0ca8a37ccc3ea00503678f6b712a7f53d6cbdc07ce02dcb85ca8a94890d1c2da20307be043faa347747abeba29185c88ba12edd5253bfca56531585
This commit is contained in:
@@ -2693,6 +2693,10 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
|
||||
error = strprintf(_("Error loading %s: Wallet requires newer version of %s"), walletFile, PACKAGE_NAME);
|
||||
return nullptr;
|
||||
}
|
||||
else if (nLoadWalletRet == DBErrors::EXTERNAL_SIGNER_SUPPORT_REQUIRED) {
|
||||
error = strprintf(_("Error loading %s: External signer wallet being loaded without external signer support compiled"), walletFile);
|
||||
return nullptr;
|
||||
}
|
||||
else if (nLoadWalletRet == DBErrors::NEED_REWRITE)
|
||||
{
|
||||
error = strprintf(_("Wallet needed to be rewritten: restart %s to complete"), PACKAGE_NAME);
|
||||
|
||||
@@ -788,7 +788,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
|
||||
#ifndef ENABLE_EXTERNAL_SIGNER
|
||||
if (pwallet->IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)) {
|
||||
pwallet->WalletLogPrintf("Error: External signer wallet being loaded without external signer support compiled\n");
|
||||
return DBErrors::TOO_NEW;
|
||||
return DBErrors::EXTERNAL_SIGNER_SUPPORT_REQUIRED;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ enum class DBErrors
|
||||
CORRUPT,
|
||||
NONCRITICAL_ERROR,
|
||||
TOO_NEW,
|
||||
EXTERNAL_SIGNER_SUPPORT_REQUIRED,
|
||||
LOAD_FAIL,
|
||||
NEED_REWRITE,
|
||||
NEED_RESCAN
|
||||
|
||||
Reference in New Issue
Block a user