diff options
| author | Sjors Provoost <[email protected]> | 2019-10-23 15:11:25 +0200 |
|---|---|---|
| committer | Sjors Provoost <[email protected]> | 2020-02-04 11:20:25 +0100 |
| commit | 709f8685ac37510aa145ac259753583c82280038 (patch) | |
| tree | cd2ca5aa826166b1fc059d21402c0e6e0e7ebc0b /src | |
| parent | [wallet] translate "Keypool ran out" message (diff) | |
| download | discoin-709f8685ac37510aa145ac259753583c82280038.tar.xz discoin-709f8685ac37510aa145ac259753583c82280038.zip | |
[wallet] CreateTransaction: simplify change address check
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/wallet.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index b53c25113..8e20f48ae 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2630,18 +2630,11 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std // post-backup change. // Reserve a new key pair from key pool - if (!CanGetAddresses(true)) { - strFailReason = _("Can't generate a change-address key. No keys in the internal keypool and can't generate any keys.").translated; - return false; - } CTxDestination dest; - bool ret = reservedest.GetReservedDestination(dest, true); - if (!ret) - { - strFailReason = _("Keypool ran out, please call keypoolrefill first").translated; + if (!reservedest.GetReservedDestination(dest, true)) { + strFailReason = _("Can't generate a change-address key. Please call keypoolrefill first.").translated; return false; } - scriptChange = GetScriptForDestination(dest); } CTxOut change_prototype_txout(0, scriptChange); |