utreexo / utreexod

A fully validating Bitcoin node with Utreexo support
ISC License
86 stars 19 forks source link

sizehelper, blockchain: move CalcNumEntries code to sizehelper package and fix bugs #165

Closed kcalvinalvin closed 2 months ago

kcalvinalvin commented 2 months ago

The test code for CalcNumEntries is moved and is made better by adding more test cases for it. This catches the bug where the current code isn't accurate to 1% of the requested maxSize.

CalcNumEntries wasn't so accurate as it was leaving some room that could've been utilized. The code is changed to check for more sizes and is now accurate up to 0.1% of the requested maxSize.