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 · 2 comments
Open

Why pow.Validate() false #86

zero-guixu opened this issue Apr 26, 2023 · 2 comments

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

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

No branches or pull requests

2 participants