diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-02-13 21:06:29 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-04-23 13:59:48 -0400 |
commit | 3c19fdd2a2fd5394fcfa75b2ba84ab2277cbdabf (patch) | |
tree | d6aa7b17c0c110b6cfe9cc9fbc771a2078568a04 /src/wallet | |
parent | 388ba94231f2f10a0be751c562cdd4650510a90a (diff) |
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')
-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 5ffeb9e44d..19ad61ac5e 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"); |