nebulasio / go-nebulas

Official Go implementation of the Nebulas protocol.
https://nebulas.io
GNU Lesser General Public License v3.0
712 stars 203 forks source link

Multiple nodes run at the same time with occasional crashes #6

Closed LeonLi000 closed 6 years ago

LeonLi000 commented 6 years ago

When I deploy on four servers, the seed nodes will collapse inexplicably. The error stack information:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa567c8]

goroutine 733 [running]:
github.com/nebulasio/go-nebulas/core.(*Block).Nonce(...)
    /root/go/src/github.com/nebulasio/go-nebulas/core/block.go:191
github.com/nebulasio/go-nebulas/consensus/pow.(*MiningState).searchingNonce(0xc4201b39e0)
    /root/go/src/github.com/nebulasio/go-nebulas/consensus/pow/mining.go:84 +0x68
created by github.com/nebulasio/go-nebulas/consensus/pow.(*MiningState).Enter
    /root/go/src/github.com/nebulasio/go-nebulas/consensus/pow/mining.go:66 +0x8d
LeonLi000 commented 6 years ago

This https://github.com/nebulasio/go-nebulas/commit/77818aecaa73f651b8de3ed8c22ee250c846c29b commit fix this crash bug.