programmingbitcoin icon indicating copy to clipboard operation
programmingbitcoin copied to clipboard

Answer wrong for chapter 9 exercise 12

Open jrawsthorne opened this issue 5 years ago • 0 comments

A mistake in the code leads to an incorrect answer for the exercise. The first block is used as the last block and the last block is used as the first. This results in a negative time differential thus is caught by the < TWO_WEEKS // 4 statement. This means that what is actually calculated is the minimum difficulty adjustment from block 471744 rather than the correct difficulty adjustment from block 473759. The correct answer should be 308d0118 which can be seen on a block explorer e.g. https://blockstream.info/block/000000000000000000802ba879f1b7a638dcea6ff0ceb614d91afc8683ac0502

jrawsthorne avatar Sep 15 '19 00:09 jrawsthorne