Skip to content

Commit

Permalink
refactor(ARCO-319): Revert initial blocks change
Browse files Browse the repository at this point in the history
  • Loading branch information
boecklim committed Jan 16, 2025
1 parent 3a5825a commit 26f228f
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions test/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,31 @@ func setupSut() {

// fund node
const minNumbeOfBlocks = 101
missingBlocks := minNumbeOfBlocks - info.Blocks
if missingBlocks > 0 {
// generate single blocks to ensure blocktx is able to process all blocks in order
const blockBatch = 1 // should be less or equal n*10 where n is number of blocktx instances

for range missingBlocks {
log.Println("==== gen block")
if info.Blocks < minNumbeOfBlocks {
// generate blocks in part to ensure blocktx is able to process all blocks
const blockBatch = 20 // should be less or equal n*10 where n is number of blocktx instances

for {
_, err = bitcoind.Generate(blockBatch)
if err != nil {
log.Fatalln(err)
}

// give time to send all INV messages
time.Sleep(20 * time.Millisecond)
time.Sleep(5 * time.Second)

info, err = bitcoind.GetInfo()
if err != nil {
log.Fatalln(err)
}

missingBlocks := minNumbeOfBlocks - info.Blocks
if missingBlocks < 0 {
break
}
}
}
time.Sleep(5 * time.Second)

time.Sleep(5 * time.Second) // wait for fillGaps to fill eventual gaps
}
}

0 comments on commit 26f228f

Please sign in to comment.