func validChain(chain []*block) bool {
	for i := 1; i < len(chain); i++ {
		b := chain[i]
		if b.PreviousHash != bc.hash(b) {
			return false
		}

		if !validProof(chain[i-1].Proof, b.Proof) {
			return false
		}
	}
	return true
}
// Determine if a given blockchain is valid
Determine if a given blockchain is valid
// Determine if a given blockchain is valid
func validChain(chain []*block) bool {
	for i := 1; i < len(chain); i++ {
		b := chain[i]
		if b.PreviousHash != bc.hash(b) {
			return false
		}
		if !validProof(chain[i-1].Proof, b.Proof) {
			return false
		}
	}
	return true
}
func validChain ( chain [ ] * block ) bool { for i := 1 ; i < len ( chain ) ; i ++ { b := chain [ i ] if b . PreviousHash != bc . hash ( b ) { return false } if ! validProof ( chain [ i - 1 ] . Proof , b . Proof ) { return false } } return true }
Determine if a given blockchain is valid
Determine if a given blockchain is valid