Skip to content

Commit

Permalink
coinselection: fail KnapsackSolver if the policy asset doesn't have a…
Browse files Browse the repository at this point in the history
… solution
  • Loading branch information
jamesdorfman committed Oct 23, 2023
1 parent 5b72ae2 commit 04cba29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/coinselection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ std::optional<SelectionResult> KnapsackSolver(std::vector<OutputGroup>& groups,

if (auto inner_result = KnapsackSolver(inner_groups, policy_target, ::policyAsset)) {
result.AddInput(*inner_result);
} else {
LogPrint(BCLog::SELECTCOINS, "Not enough funds to create target %d for policy asset %s\n", policy_target, ::policyAsset.GetHex());
return std::nullopt;
}
}

Expand Down

0 comments on commit 04cba29

Please sign in to comment.