Closed metalicjames closed 6 years ago
In fact, syncing testnet is now impossible due to this bug.
I hit another reorg a while back and it seemed to work, so the problem seems to be much deeper than I initially expected:
2018/06/28 11:33:55.457393 reorg from height 1335735 to 1335736
2018/06/28 11:33:55.457403 TEMPCUR.BITS 469827583
2018/06/28 11:33:55.457409 TEMPCUR.BITS 469827583
2018/06/28 11:33:55.459122 HeightHandler: oh no, reorg!
2018/06/28 11:33:55.459169 Rollback height 1335734
2018/06/28 11:33:55.459188 tx height 1316917
2018/06/28 11:33:55.459194 tx height 1326486
2018/06/28 11:33:55.459199 tx height 1326486
2018/06/28 11:33:55.459202 tx height 0
2018/06/28 11:33:55.459207 tx height 1287022
2018/06/28 11:33:55.459210 tx height 1316917
2018/06/28 11:33:55.459214 tx height 1320430
2018/06/28 11:33:55.459218 tx height 0
2018/06/28 11:33:55.459222 tx height 1291926
2018/06/28 11:33:55.459226 tx height 1291926
2018/06/28 11:33:55.459231 Rollback db. 0 utxos lost
2018/06/28 11:33:55.459352 Added 2 headers OK.
2018/06/28 11:33:55.459378 got header tip height 1335736
2018/06/28 11:33:55.459983 get headers message has 18 header hashes, first one is 000000000000847058257d2fc0caf4ad04ac8886d947654f967e9010c42abaa2
2018/06/28 11:33:55.572999 got 0 headers, we're probably synced up
2018/06/28 11:33:55.573049 blockTip to 1335734 headerTip 1335736
Looks like 1 block re-orgs do work fine, two block re-orgs seem to not:
2018/06/28 11:28:09.299412 reorg from height 1335639 to 1335640
2018/06/28 11:28:09.299425 TEMPCUR.BITS 469827583
2018/06/28 11:28:09.299435 TEMPCUR.BITS 469827583
2018/06/28 11:28:09.301285 HeightHandler: oh no, reorg!
2018/06/28 11:28:09.301330 Rollback height 1335638
2018/06/28 11:28:09.301356 tx height 1316917
2018/06/28 11:28:09.301365 tx height 1326486
2018/06/28 11:28:09.301370 tx height 1326486
2018/06/28 11:28:09.301375 tx height 0
2018/06/28 11:28:09.301380 tx height 1287022
2018/06/28 11:28:09.301384 tx height 1316917
2018/06/28 11:28:09.301389 tx height 1320430
2018/06/28 11:28:09.301393 tx height 0
2018/06/28 11:28:09.301398 tx height 1291926
2018/06/28 11:28:09.301402 tx height 1291926
2018/06/28 11:28:09.301407 Rollback db. 0 utxos lost
2018/06/28 11:28:09.301474 Added 2 headers OK.
2018/06/28 11:28:09.301491 got header tip height 1335640
Fixed (hopefully) in #248
Reorgs can cause the difficulty to be calculated incorrectly. @Varunram