ethresearch / sharding-p2p-poc

Proof of Concept of Ethereum Serenity Peer-to-Peer Layer on libp2p PubSub System
40 stars 19 forks source link

Fix nil event notifier #95

Closed NIC619 closed 5 years ago

NIC619 commented 5 years ago

What was wrong?

eventnotifier was set to nil if there was no event notifier server. However it was an interface with its value being nil, not a nil interface. So the comparison n.eventnotifier != nil will always return true.

How was it fixed?

Compare n.eventnotifier against typed nil

Cute Animal Picture

pic credit: maxpixel

mhchia commented 5 years ago

Thanks a lot for discovering and solving this issue Add the reference to the discussion: https://groups.google.com/forum/#!topic/golang-nuts/wnH302gBa4I/discussion