Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the sanity check in udata SerializeSize() to a test #258

Open
kcalvinalvin opened this issue Mar 1, 2021 · 0 comments
Open

Move the sanity check in udata SerializeSize() to a test #258

kcalvinalvin opened this issue Mar 1, 2021 · 0 comments

Comments

@kcalvinalvin
Copy link
Member

The code snippet here is responsible for a lot of memory allocations.

utreexo/btcacc/udata.go

Lines 124 to 129 in 259fc1a

b.Reset()
ud.AccProof.Serialize(&b)
if b.Len() != ud.AccProof.SerializeSize() {
fmt.Printf(" b.Len() %d, AccProof.SerializeSize() %d\n",
b.Len(), ud.AccProof.SerializeSize())
}

We can instead move this to a test so that we don't have this overhead for the binary

@kcalvinalvin kcalvinalvin changed the title Move the sanity check in udata to a test Move the sanity check in udata SerializeSize() to a test Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant