Skip to content

Commit

Permalink
Add support for adding tx with more than 1in and 1out
Browse files Browse the repository at this point in the history
  • Loading branch information
polespinasa committed Apr 30, 2024
1 parent ee900c2 commit 0717b8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/grouphug-server/src/server/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0717b8a

Please sign in to comment.