peatio icon indicating copy to clipboard operation
peatio copied to clipboard

min confirmation set to 1 requires 2 confirmations

Open SimonVillage opened this issue 4 years ago • 2 comments

When setting min_confirmation to 1 the following condition will be true even if the transaction already has 1 confirmation.

app/workers/daemons/blockchain.rb:22

if bc.reload.height + bc.min_confirmations >= bc_service.latest_block_number
  logger.info { "Skip synchronization. No new blocks detected, height: #{bc.height}, latest_block: #{bc_service.latest_block_number}." }
  logger.info { 'Sleeping for 10 seconds' }
  sleep(10)
  next
end

bc.reload.height = 100 bc.min_confirmations = 1 bc_service.latest_block_number = 101

if 100 + 1 >= 101

will be true because of equal so processing will be skipped.

SimonVillage avatar May 07 '20 11:05 SimonVillage