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

client: Send empty maps instead of nil. #491

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

jholdstock
Copy link
Member

No description provided.

@davecgh
Copy link
Member

davecgh commented Oct 16, 2024

What's the point of this change? In general, using empty reference objects instead of nil unless there is a very specific reason is not ideal because it causes additional allocations.

@matheusd
Copy link
Member

Sending nil makes some VSPs fail this call, because the encoded JSON payload does not send the corresponding member (decred/dcrwallet#2402).

Ideally, vspd should loosen the requirements for these members not to be nil, but we can't necessarily rely on VSPd operators to timely update their deployments, so this fixes the issue for callers in the mean time.

This isn't a hot path, but in any case the allocation issue (which to be fair is true) can be dealt with with a global empty map.

@jholdstock jholdstock merged commit 6335ad4 into decred:master Oct 16, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants