Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why pow.Validate() false #86

Open
zero-guixu opened this issue Apr 26, 2023 · 3 comments · May be fixed by #92
Open

Why pow.Validate() false #86

zero-guixu opened this issue Apr 26, 2023 · 3 comments · May be fixed by #92

Comments

@zero-guixu
Copy link

I have seen the relevant questions but I did't found a solution.

in block.go i add code below

`

func (b *Block) HashTransactions() []byte { var transactions [][]byte

fmt.Println(b.Transactions)
for _, tx := range b.Transactions {
	transactions = append(transactions, tx.Serialize())
}

fmt.Println(transactions)
mTree := NewMerkleTree(transactions)
return mTree.RootNode.Data

`

i found the same b.Transactions have different transactions

@Anmilover
Copy link

Anmilover commented Apr 26, 2023 via email

@zero-guixu
Copy link
Author

I have fund why This is because the byte array serialized by GOB data may be inconsistent。
you can find the sloution in https://github.com/corgi-kx/blockchain_golang

@mubarizkyc mubarizkyc linked a pull request Jun 20, 2024 that will close this issue
@mubarizkyc
Copy link

Check #92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants