|
@@ -711,7 +711,9 @@ impl Mint {
|
|
|
|
|
|
let fee = self.get_proofs_fee(&swap_request.inputs).await?;
|
|
let fee = self.get_proofs_fee(&swap_request.inputs).await?;
|
|
|
|
|
|
- if proofs_total < output_total.checked_add(fee).ok_or(Error::AmountOverflow)? {
|
|
|
|
|
|
+ let total_with_fee = output_total.checked_add(fee).ok_or(Error::AmountOverflow)?;
|
|
|
|
+
|
|
|
|
+ if proofs_total < total_with_fee {
|
|
tracing::info!(
|
|
tracing::info!(
|
|
"Swap request without enough inputs: {}, outputs {}, fee {}",
|
|
"Swap request without enough inputs: {}, outputs {}, fee {}",
|
|
proofs_total,
|
|
proofs_total,
|
|
@@ -725,6 +727,20 @@ impl Mint {
|
|
));
|
|
));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if proofs_total != total_with_fee {
|
|
|
|
+ tracing::info!(
|
|
|
|
+ "Swap request unbalanced: {}, outputs {}, fee {}",
|
|
|
|
+ proofs_total,
|
|
|
|
+ output_total,
|
|
|
|
+ fee
|
|
|
|
+ );
|
|
|
|
+ return Err(Error::InsufficientInputs(
|
|
|
|
+ proofs_total.into(),
|
|
|
|
+ output_total.into(),
|
|
|
|
+ fee.into(),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+
|
|
let proof_count = swap_request.inputs.len();
|
|
let proof_count = swap_request.inputs.len();
|
|
|
|
|
|
let input_ys = swap_request
|
|
let input_ys = swap_request
|