Skip to content

Commit

Permalink
Merge pull request DNAProject#6 from laizy/hash_race_condition
Browse files Browse the repository at this point in the history
fix block hash race condition
  • Loading branch information
Arbio5zt authored May 24, 2018
2 parents 52e2261 + 6247fe8 commit bb93dc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/ledger/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ func (b *Block) GetPrograms() []*program.Program {

func (b *Block) Hash() Uint256 {
if b.hash == nil {
b.hash = new(Uint256)
*b.hash = b.Blockdata.Hash()
hash = b.Blockdata.Hash()
b.hash = &hash
}
return *b.hash
}
Expand Down

0 comments on commit bb93dc5

Please sign in to comment.