From cf6771596bf5e94691b3692319d1c30816eeef19 Mon Sep 17 00:00:00 2001 From: DanGould Date: Tue, 21 May 2024 11:10:45 -0400 Subject: [PATCH] Contribute even when a sender makes no change A pure consolidation does not suffer from Unnecessary Input Heuristic. A Payjoin consolidation without sender change still breaks Common Input Heuristic. Allow it. --- payjoin/src/receive/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/payjoin/src/receive/mod.rs b/payjoin/src/receive/mod.rs index e99c1bdd..c8c83124 100644 --- a/payjoin/src/receive/mod.rs +++ b/payjoin/src/receive/mod.rs @@ -361,8 +361,9 @@ impl ProvisionalProposal { return Err(SelectionError::from(InternalSelectionError::Empty)); } - if self.payjoin_psbt.outputs.len() != 2 { - // Current UIH techniques only support many-input, two-output transactions. + if self.payjoin_psbt.outputs.len() > 2 { + // This UIH avoidance function supports only + // many-input, n-output transactions such that n <= 2 for now return Err(SelectionError::from(InternalSelectionError::TooManyOutputs)); }