No zeros#313
Closed
n8mgr wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR prevents walletd from indexing events that have zero-value effects on the wallet’s balance.
- Added non-zero checks before emitting events for Siacoin, Siafund, file contract outputs, miner payouts, and foundation subsidies
- Refactored file contract output loops to filter out zero-value outputs early
- Documented the fix in the changeset
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| wallet/wallet.go | Added !Value.IsZero() (or != 0) guards on all event additions to skip zero-value outputs |
| .changeset/fixed_an_issue_with_zero_value_events_being_added_to_the_wallet.md | Added a changelog entry for the zero-value event fix |
Comments suppressed due to low confidence (2)
.changeset/fixed_an_issue_with_zero_value_events_being_added_to_the_wallet.md:5
- [nitpick] Use the imperative mood in changelog titles (e.g., "Fix an issue with zero-value events being added to the wallet") to align with conventional commit and changeset conventions.
# Fixed an issue with zero value events being added to the wallet.
wallet/wallet.go:394
- This closing brace may be extraneous or misaligned, which could alter the intended control flow—please verify block delimiters and remove any unnecessary braces.
}
peterjan
approved these changes
Jun 14, 2025
ChrisSchinnerl
left a comment
Member
There was a problem hiding this comment.
Looks alright but has no testing
Member
|
@n8maninger do you still intend to merge this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Events that do not change a wallet's balance should not be indexed by
walletd.