Skip to content

wallet/udb: remove unused UTXO value assignment - #2651

Open
daixiheguu wants to merge 1 commit into
decred:masterfrom
daixiheguu:refactor-drop-unused-utxo-value
Open

wallet/udb: remove unused UTXO value assignment#2651
daixiheguu wants to merge 1 commit into
decred:masterfrom
daixiheguu:refactor-drop-unused-utxo-value

Conversation

@daixiheguu

Copy link
Copy Markdown

Discard the value returned by randomUTXO in the mined-transaction test helper because the value is unconditionally replaced by bucket.Get(k) before it can be read.

The key selection remains unchanged, while the code no longer suggests that the original value is used and staticcheck SA4006 is resolved.

Tested with:

`go test ./wallet/udb`

Signed-off-by: daixiheguu <daixihegu@outlook.com>

@jholdstock jholdstock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd go one step further with this and move the declaration of v down to where it is actually used (just above if !unmined).

The copyright header should also be updated to 2026.

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.

2 participants