Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nosequeldeebee committed Feb 26, 2018
2 parents c52794b + 679e984 commit f92600d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions networking/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ func isBlockValid(newBlock, oldBlock Block) bool {

// make sure the chain we're checking is longer than the current blockchain
func replaceChain(newBlocks []Block) {
mutex.Lock()
if len(newBlocks) > len(Blockchain) {
Blockchain = newBlocks
}
mutex.Unlock()
}

// SHA256 hasing
Expand Down

0 comments on commit f92600d

Please sign in to comment.