diff options
| author | Andrew Chow <[email protected]> | 2020-02-13 21:06:29 -0500 |
|---|---|---|
| committer | Andrew Chow <[email protected]> | 2020-04-23 13:59:48 -0400 |
| commit | 3c19fdd2a2fd5394fcfa75b2ba84ab2277cbdabf (patch) | |
| tree | d6aa7b17c0c110b6cfe9cc9fbc771a2078568a04 /src/wallet/wallet.cpp | |
| parent | Change wallet_encryption.py to use signmessage instead of dumpprivkey (diff) | |
| download | discoin-3c19fdd2a2fd5394fcfa75b2ba84ab2277cbdabf.tar.xz discoin-3c19fdd2a2fd5394fcfa75b2ba84ab2277cbdabf.zip | |
Return error when no ScriptPubKeyMan is available for specified type
When a CWallet doesn't have a ScriptPubKeyMan for the requested type
in GetNewDestination, give a meaningful error. Also handle this in
Qt which did not do anything with errors.
Diffstat (limited to 'src/wallet/wallet.cpp')
| -rw-r--r-- | src/wallet/wallet.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 5ffeb9e44..19ad61ac5 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3227,6 +3227,8 @@ bool CWallet::GetNewDestination(const OutputType type, const std::string label, if (spk_man) { spk_man->TopUp(); result = spk_man->GetNewDestination(type, dest, error); + } else { + error = strprintf("Error: No %s addresses available.", FormatOutputType(type)); } if (result) { SetAddressBook(dest, label, "receive"); |