umbracle / ethgo

Ethereum Golang API
https://www.ethgoproject.io
Mozilla Public License 2.0
484 stars 134 forks source link

Fix tracker errors after a block reorganization #247

Closed Nemanja0x closed 1 year ago

Nemanja0x commented 1 year ago

The problem is when reorganization occurs on chain, so the parent block does not exist any more. function handleReconcileImpl() should check if the obtained block is nil (parent == nil): parent, err := t.provider.GetBlockByHash(block.ParentHash, false)

There are some additional places in blocktracker.go and tracker.go which should be handled also. They are introduces in this PR as well.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ethgo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2023 0:44am