that was not the old protocal ... the old was 2.5 * 24
Yes that is my point, currently the code does:
0.5 * (24 * 60 * 60) * 4 == 2.0 * (24 * 60 * 60)but shouldn't it be:
0.5 * (24 * 60 * 60) * 5 == 2.5 * (24 * 60 * 60) ?
You looking at 6.4.5 code.. 6.4.7 is (5 * 24 * 60 * 60) / 8
Oh right, so you've addressed that already together with the sync issue (or it was actually causing it). Now I'm seeing it:
https://github.com/phenixcoin/Phenixcoin/commit/075d96d75873007d3d8997204cfaa2f3bf7507c2I was only looking at the most recent commit earlier:
https://github.com/phenixcoin/Phenixcoin/commit/48e6768f2bae47df679244108962fb67b1b89809But actually I think this introduces an even more severe bug because now it affects the future blockchain instead of just the verification of the existing chain prior to the difficulty protocol change.
Look at the current code in the repo
https://github.com/phenixcoin/Phenixcoin/blob/master/src/main.cpp:
840 static const int64 nTargetTimespan = (5 * 24 * 60 * 60) / 8; // Phenixcoin: 2.5 days
841 static const int64 nTargetSpacing = 1.5 * 60; // Phenixcoin: 1.5 minutes
..
886 int64 nTargetTimespanCurrent = fNewDifficultyProtocol? nTargetTimespan : (nTargetTimespan*4);
887 int64 nInterval = nTargetTimespanCurrent / nTargetSpacing;
Apart from the comment still not matching the code:
(5 * 24 * 60 * 60) / 8 == (5/8) * (24 * 60 * 60) == 0.625 * (24 * 60 * 60) == 0.625 daysthe far more serious issue is that now the
nInterval isn't 480 anymore if
fNewDifficultyProtocol is true, that is if we are past block 46500 where the difficulty protocol adjustment applies.
Now it's basically the other way around, for the old protocol we do correctly get:
nInterval = (((5 * 24 * 60 * 60) / 8) * 4) / (1.5 * 60) = 2400
which is the number of blocks until difficulty retarget as specified in the original forum announcement and on phenixcoin.com, and which in part explains why the block verification during the wallet sync doesn't fail anymore for retarget blocks which caused the sync to get stuck.
But now for the new protocol we get:
nInterval = ((5 * 24 * 60 * 60) / 8) / (1.5 * 60) = 600
which isn't the 480 blocks as defined in the recent difficulty protocol fix!
I guess this should be fixed urgently before the next difficulty retarget occursAnd I still think this would fully fix it:
840 static const int64 nTargetTimespan = 0.5 * 24 * 60 * 60; // Phenixcoin: 12 hours
841 static const int64 nTargetSpacing = 1.5 * 60; // Phenixcoin: 1.5 minutes
..
886 int64 nTargetTimespanCurrent = fNewDifficultyProtocol? nTargetTimespan : (nTargetTimespan*5); // NOTE THE *5 HERE
887 int64 nInterval = nTargetTimespanCurrent / nTargetSpacing;