KomodoPlatform / zebra

An ongoing Rust implementation of a Komodo node. 🦓
Apache License 2.0
3 stars 5 forks source link

Fix best_chain() to require it to have the last nota #44

Closed dimxy closed 1 year ago

dimxy commented 1 year ago

Before this fix best_chain selected a branch just with the most power. This contradicts to the algo in komodod when the active chain always has a nota and creates a risk when some old branch with a low of work, without a nota, may be presented to the user as the best chain. This PR resolves this by making best_chain() select not only the branch with most work but also with the last nota.

Adds a yet another fix to #10 and closes it