From 6bbc5b2b7e0175bce5f05edf82e744adc1045461 Mon Sep 17 00:00:00 2001 From: coderofstuff <114628839+coderofstuff@users.noreply.github.com> Date: Fri, 29 Dec 2023 15:29:34 -0700 Subject: [PATCH] WIP simpa fix --- simpa/src/simulator/miner.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/simpa/src/simulator/miner.rs b/simpa/src/simulator/miner.rs index c845e64022..d7eb40bde4 100644 --- a/simpa/src/simulator/miner.rs +++ b/simpa/src/simulator/miner.rs @@ -141,7 +141,11 @@ impl Miner { .take(self.target_txs_per_block as usize) .collect::>() .into_par_iter() - .map(|mutable_tx| sign(mutable_tx, schnorr_key).tx) + .map(|mutable_tx| { + let mut signed_tx = sign(mutable_tx, schnorr_key).tx; + signed_tx.finalize(); + signed_tx + }) .collect::>(); for outpoint in txs.iter().flat_map(|t| t.inputs.iter().map(|i| i.previous_outpoint)) { @@ -168,7 +172,7 @@ impl Miner { } fn create_unsigned_tx(&self, outpoint: TransactionOutpoint, input_amount: u64, multiple_outputs: bool) -> Transaction { - Transaction::new( + Transaction::new_non_finalized( 0, vec![TransactionInput::new(outpoint, vec![], 0, 0)], if multiple_outputs && input_amount > 4 {