Skip to content

Commit

Permalink
coinselection: fail if each non-policy asset doesn't have a solution
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdorfman authored and delta1 committed Oct 23, 2023
1 parent d3ffd2a commit 5b72ae2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/wallet/coinselection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ std::optional<SelectionResult> KnapsackSolver(std::vector<OutputGroup>& 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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/functional/wallet_elements_regression_1259.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b72ae2

Please sign in to comment.