diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp index 41ed9acb46..9d8ad24be0 100644 --- a/src/wallet/coinselection.cpp +++ b/src/wallet/coinselection.cpp @@ -308,6 +308,9 @@ std::optional KnapsackSolver(std::vector& groups, non_policy_effective_value += ic.effective_value; } result.AddInput(inner_result.value()); + } else { + LogPrint(BCLog::SELECTCOINS, "Not enough funds to create target %d for asset %s\n", it->second, it->first.GetHex()); + return std::nullopt; } } diff --git a/test/functional/wallet_elements_regression_1259.py b/test/functional/wallet_elements_regression_1259.py index 88e9c3bb8c..e6499d443e 100755 --- a/test/functional/wallet_elements_regression_1259.py +++ b/test/functional/wallet_elements_regression_1259.py @@ -2,7 +2,7 @@ # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -"""Tests that fundrawtransaction correcly handles the case of sending many +"""Tests that fundrawtransaction correctly handles the case of sending many inputs of an issued asset, with no policy asset recipient. See: https://github.com/ElementsProject/elements/issues/1259