Fix the sieving of BiTwin candidates (thanks to rdebourbon).

The last member of a BiTwin chain was not sieved at all if the target chain length was odd.
The chains/day estimate was also inflated on mainnet because of this issue.
master
Mikael Hirki 2013-09-11 19:03:18 +03:00
parent ee99f55c10
commit 09466ac127
1 changed files with 2 additions and 2 deletions

View File

@ -1045,7 +1045,7 @@ bool CSieveOfEratosthenes::Weave()
vfCompositeBiTwin[nWord] |= vfCompositeLayerCC1[nWord] | vfCompositeLayerCC2[nWord];
}
}
else if (nLayerSeq < nBiTwinCC2Layers)
else if (nLayerSeq < nBiTwinCC1Layers)
{
for (unsigned int nWord = nMinWord; nWord < nMaxWord; nWord++)
{
@ -1083,7 +1083,7 @@ bool CSieveOfEratosthenes::Weave()
vfExtTWN[nWord] |= vfCompositeLayerCC1[nWord] | vfCompositeLayerCC2[nWord];
}
}
else if (nLayerExtendedSeq < nBiTwinCC2Layers)
else if (nLayerExtendedSeq < nBiTwinCC1Layers)
{
for (unsigned int nWord = nExtMinWord; nWord < nMaxWord; nWord++)
{