Replace our current PoW algorithm with oPoW

This commit is contained in:
Elichai Turkel 2021-11-06 21:46:25 +02:00
parent 98a7925eb6
commit c87fbddf2f
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F

View File

@ -52,7 +52,10 @@ func CalculateProofOfWorkValue(header externalapi.MutableBlockHeader) *big.Int {
if err != nil { if err != nil {
panic(errors.Wrap(err, "this should never happen. Hash digest should never return an error")) panic(errors.Wrap(err, "this should never happen. Hash digest should never return an error"))
} }
return toBig(writer.Finalize()) powHash := writer.Finalize()
matrix := generateMatrix(powHash)
heavyHash := matrix.HeavyHash(powHash)
return toBig(heavyHash)
} }
// ToBig converts a externalapi.DomainHash into a big.Int treated as a little endian string. // ToBig converts a externalapi.DomainHash into a big.Int treated as a little endian string.