picks up #25269.
AmountWithFeeExceedsBalance error inside WalletModel::prepareTransaction is never thrown and remains an unused code path. This is because createTransaction does not retrieve the fee when the process fails. The fee return arg is set only at the end of the process, when the transaction is successfully created. Therefore, if the transaction creation fails, the fee is not available inside WalletModel::prepareTransaction to trigger the AmountWithFeeExceedsBalance error.
This PR re-implements the feature inside CreateTransactionInternal and adds test coverage for it.
| on master | on PR |
|---|---|
the unreachable code path is removed in https://github.com/bitcoin-core/gui/pull/807 which requires this PR.