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

[WIP] sweepbatcher: fix some minor bugs #871

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

starius
Copy link
Collaborator

@starius starius commented Jan 9, 2025

Fix minor bugs identified during testing.

  1. Populate batch.currentHeight beforehand, ensuring it's set before monitorSpend is launched. Without this, the entire batcher could crash with the error: "a height hint greater than 0 must be provided."
  2. Add a check to verify that the spending transaction has at least one output before inspecting it. In testing, a transaction with no outputs triggered a panic.
  3. Remove the unused batch.blockEpochChan field.

Pull Request Checklist

  • Update release_notes.md if your PR contains major features, breaking changes or bugfixes

Previously the code handling spending tx crashed if it doesn't have an output.
This is likely to occur only in tests.
Prevent a crash with "a height hint greater than 0 must be provided" error when
monitorSpend starts at the beginning of batch.Run.

The timer timerChan is now initialized at the start, because it was previously
initialized after the first block (the current tip) was read from blockChan and
now the first block is read before the main for-select loop to fill the field
currentHeight in advance.
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.

1 participant