Work decoupled from #25806, which cleanup and improves the Coin Selection flow further.
Adding the capability to propagate specific error messages from the Coin Selection process to the user. Instead of always returning the general “Insufficient funds” message which is not always accurate to what happened internally. Letting us instruct the user how to proceed under certain circumstances.
The following error messages were added:
-
If the selection result exceeds the maximum transaction weight, we now will return: -> “The inputs size exceeds the maximum weight. Please try sending a smaller amount or manually consolidating your wallet’s UTXOs”.
-
If the user pre-selected inputs and disallowed the automatic coin selection process (no other inputs are allowed), we now will return: -> “The preselected coins total amount does not cover the transaction target. Please allow other inputs to be automatically selected or include more coins manually”.
-
The double-counted preset inputs during Coin Selection error will now throw an “internal bug detected” message instead of crashing the node.
The essence of this work comes from several comments:
- #26560 (review)
- #25729 (review)
- #25269#pullrequestreview-1135240825
- #23144 (which is connected to #24845)