parser: Correctly serialize Equihash solution

This commit is contained in:
Jack Grigg
2019-05-23 14:09:43 +01:00
parent c4a48902db
commit 49a1552523
2 changed files with 47 additions and 11 deletions

View File

@@ -91,7 +91,7 @@ func TestBlockHeader(t *testing.T) {
}
lastBlockTime = blockHeader.Time
if len(blockHeader.Solution) != EQUIHASH_SIZE {
if len(blockHeader.Solution) != equihashSizeMainnet {
t.Error("Got wrong Equihash solution size.")
break
}
@@ -103,7 +103,7 @@ func TestBlockHeader(t *testing.T) {
break
}
if !bytes.Equal(serializedHeader, blockData[:SER_BLOCK_HEADER_SIZE]) {
if !bytes.Equal(serializedHeader, blockData[:serBlockHeaderMinusEquihashSize+3+equihashSizeMainnet]) {
offset := 0
length := 0
for i := 0; i < len(serializedHeader); i++ {