Skip to content

Commit

Permalink
Merge pull request #100 from mempool/junderw/fix-testnet4-sync
Browse files Browse the repository at this point in the history
Fix Popular Scripts script when zero history
  • Loading branch information
wiz authored Sep 4, 2024
2 parents 583d9e9 + 1a21b53 commit 78155de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bin/popular-scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ fn run_iterator(
"Thread ({thread_id:?}) Seeking DB to beginning of tx histories for b'H' + {}",
hex::encode([first_byte])
);
// H = 72
let mut compare_vec: Vec<u8> = vec![72, first_byte];
let mut compare_vec: Vec<u8> = vec![b'H', first_byte];
iter.seek(&compare_vec); // Seek to beginning of our section

// Insert the byte of the next section for comparing
Expand All @@ -122,7 +121,7 @@ fn run_iterator(
while iter.valid() {
let key = iter.key().unwrap();

if is_finished(key) {
if key.is_empty() || key[0] != b'H' || is_finished(key) {
// We have left the txhistory section,
// but we need to check the final scripthash
send_if_popular(
Expand Down

0 comments on commit 78155de

Please sign in to comment.