File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -940,7 +940,9 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
940940
941941 // The only time that fee_needed should be less than the amount available for fees is when
942942 // we are subtracting the fee from the outputs. If this occurs at any other time, it is a bug.
943- assert (coin_selection_params.m_subtract_fee_outputs || fee_needed <= nFeeRet);
943+ if (!coin_selection_params.m_subtract_fee_outputs && fee_needed > nFeeRet) {
944+ return util::Error{Untranslated (STR_INTERNAL_BUG (" Fee needed > fee paid" ))};
945+ }
944946
945947 // If there is a change output and we overpay the fees then increase the change to match the fee needed
946948 if (nChangePosInOut != -1 && fee_needed < nFeeRet) {
You can’t perform that action at this time.
0 commit comments