From 5b1ff06c14a47bd40ddd952c181a703051137244 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Wed, 30 May 2018 10:38:33 +0300 Subject: [PATCH] fix dup tx hashes in bencher --- bencher/src/database.rs | 7 +++++++ bencher/src/verifier.rs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/bencher/src/database.rs b/bencher/src/database.rs index 85498439..0ea4df5c 100644 --- a/bencher/src/database.rs +++ b/bencher/src/database.rs @@ -23,6 +23,7 @@ pub fn fetch(benchmark: &mut Benchmark) { let next_block = test_data::block_builder() .transaction() .coinbase() + .lock_time(x as u32) .output().value(5000000000).build() .build() .merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build() @@ -65,6 +66,7 @@ pub fn write(benchmark: &mut Benchmark) { let next_block = test_data::block_builder() .transaction() .coinbase() + .lock_time(x as u32) .output().value(5000000000).build() .build() .merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build() @@ -102,6 +104,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { let next_block = test_data::block_builder() .transaction() .coinbase() + .lock_time(x as u32) .output().value(5000000000).build() .build() .merkled_header().parent(rolling_hash.clone()).nonce(x as u32 * 4).build() @@ -112,6 +115,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { let next_block_side = test_data::block_builder() .transaction() .coinbase() + .lock_time(x as u32) .output().value(5000000000).build() .build() .merkled_header().parent(base).nonce(x as u32 * 4 + 2).build() @@ -122,6 +126,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { let next_block_side_continue = test_data::block_builder() .transaction() .coinbase() + .lock_time(x as u32) .output().value(5000000000).build() .build() .merkled_header().parent(next_base).nonce(x as u32 * 4 + 3).build() @@ -131,6 +136,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) { let next_block_continue = test_data::block_builder() .transaction() .coinbase() + .lock_time(x as u32) .output().value(5000000000).build() .build() .merkled_header().parent(rolling_hash.clone()).nonce(x as u32 * 4 + 1).build() @@ -199,6 +205,7 @@ pub fn write_heavy(benchmark: &mut Benchmark) { let next_block = test_data::block_builder() .transaction() .coinbase() + .lock_time(x as u32) .output().value(5000000000).build() .build() .merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build() diff --git a/bencher/src/verifier.rs b/bencher/src/verifier.rs index 9f5afe51..cd54bf9d 100644 --- a/bencher/src/verifier.rs +++ b/bencher/src/verifier.rs @@ -34,6 +34,7 @@ pub fn main(benchmark: &mut Benchmark) { LittleEndian::write_u64(&mut coinbase_nonce[..], x as u64); let next_block = test_data::block_builder() .transaction() + .lock_time(x as u32) .input() .coinbase() .signature_bytes(coinbase_nonce.to_vec().into()) @@ -62,6 +63,7 @@ pub fn main(benchmark: &mut Benchmark) { LittleEndian::write_u64(&mut coinbase_nonce[..], (b + BLOCKS_INITIAL) as u64); let mut builder = test_data::block_builder() .transaction() + .lock_time(b as u32) .input().coinbase().signature_bytes(coinbase_nonce.to_vec().into()).build() .output().value(5000000000).build() .build();