From 0717b8a258ab62f00b22ebd8cacff68b8711c992 Mon Sep 17 00:00:00 2001 From: Pol Espinasa Date: Tue, 30 Apr 2024 20:59:08 +0200 Subject: [PATCH] Add support for adding tx with more than 1in and 1out --- server/grouphug-server/src/server/group.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/grouphug-server/src/server/group.rs b/server/grouphug-server/src/server/group.rs index d76246b..46a8d1c 100644 --- a/server/grouphug-server/src/server/group.rs +++ b/server/grouphug-server/src/server/group.rs @@ -50,12 +50,14 @@ impl Group { let tx: Transaction = deserialize(&hex_decode(tx_hex).unwrap()).unwrap(); - self.transactions.push((tx.input[0].clone(), tx.output[0].clone())); + for i in 0..tx.input.len() { + self.transactions.push((tx.input[i].clone(), tx.output[i].clone())); + } println!("Tx {} added to group with fee_rate {}sat/vB", tx.txid(), self.fee_rate); // Check if the group should be closed according to the MAX_SIZE limit established in config file - if self.transactions.len() == crate::CONFIG.group.max_size { + if self.transactions.len() >= crate::CONFIG.group.max_size { return self.close_group(); } return false;