From 3c654f38eb623e413238a596ee3397d0139a1dd1 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 5 Aug 2016 18:15:34 +1200 Subject: [PATCH] Eliminate probably duplicates in final round This is more likely to eliminate valid solutions than doing so in intermediate rounds, but the probability is still very low. --- src/crypto/equihash.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/crypto/equihash.cpp b/src/crypto/equihash.cpp index d2686a263..9c018d72f 100644 --- a/src/crypto/equihash.cpp +++ b/src/crypto/equihash.cpp @@ -487,8 +487,12 @@ bool Equihash::OptimisedSolve(const eh_HashState& base_state, for (int l = 0; l < j - 1; l++) { for (int m = l + 1; m < j; m++) { - TruncatedStepRow res(Xt[i+l], Xt[i+m], hashLen, lenIndices, 0); - partialSolns.push_back(res.GetTruncatedIndices(hashLen, 2*lenIndices)); + TruncatedStepRow res(Xt[i+l], Xt[i+m], + hashLen, lenIndices, 0); + auto soln = res.GetTruncatedIndices(hashLen, 2*lenIndices); + if (!IsProbablyDuplicate(soln, 2*lenIndices)) { + partialSolns.push_back(soln); + } } }