浏览代码

fix(wallet): swap for proofs with conditons in send

thesimplekid 11 月之前
父节点
当前提交
91e18236d8
共有 1 个文件被更改,包括 10 次插入8 次删除
  1. 10 8
      crates/cdk/src/wallet.rs

+ 10 - 8
crates/cdk/src/wallet.rs

@@ -730,14 +730,16 @@ impl Wallet {
     ) -> Result<String, Error> {
         let input_proofs = self.select_proofs(mint_url.clone(), unit, amount).await?;
 
-        let send_proofs = match input_proofs
-            .iter()
-            .map(|p| p.amount)
-            .sum::<Amount>()
-            .eq(&amount)
-        {
-            true => Some(input_proofs),
-            false => {
+        let send_proofs = match (
+            input_proofs
+                .iter()
+                .map(|p| p.amount)
+                .sum::<Amount>()
+                .eq(&amount),
+            &conditions,
+        ) {
+            (true, None) => Some(input_proofs),
+            _ => {
                 self.swap(mint_url, unit, Some(amount), input_proofs, conditions)
                     .await?
             }