Skip to content

fix(htnwallet): wait after a rate-limited auto-compound broadcast - #131

Merged
MattF42 merged 1 commit into
HoosatNetwork:2.19.2from
Evern00b-fi:fix/htnwallet-compound-rate-limit-wait
Nov 30, 2026
Merged

MattF42 merged 1 commit into
HoosatNetwork:2.19.2from
Evern00b-fi:fix/htnwallet-compound-rate-limit-wait

Conversation

@Evern00b-fi

Copy link
Copy Markdown

Depends on: nothing.

Problem. The node allows each address a limited number of compound transactions per minute. When auto-compound hit that limit, it printed "RATE LIMITED, backing off for 30s" and then did not wait: the next attempt came with the next tick, as little as six seconds later, into the same limit.

Change. The message and the wait for a refused compound broadcast now come from one function, compoundBroadcastFailure: 30 s after a rate limit, 5 s after stale inputs ("already spent by transaction") and 30 s after any other refusal. Only the rate-limit wait changes; the other two keep their messages and waits.

Validation. TestCompoundBroadcastFailureBackoff checks message and wait for the three kinds of refusal, and TestCompoundOnceWaitsAfterRateLimit runs compoundOnce against a stub daemon that refuses every broadcast and checks with a fake clock that it waits at least 30 s. With the old code the rate-limited attempt returned after 0 s; the tests call the new function, so for that comparison the old code was put behind the same stub. gofmt -l, go vet ./cmd/htnwallet/... and go test -race -count=1 ./cmd/htnwallet/... pass with Go 1.27.4 on linux/amd64.

Compatibility and limits. Only the auto-compound command changes; the daemon, its API and the keys file do not. The wait is a fixed 30 s, not adapted to the node's actual limit window.

AI disclosure: prepared with AI assistance (OpenAI Codex and Claude by Anthropic).

auto-compound printed "backing off for 30s" after a rate-limit refusal but
did not wait, so the next attempt came with the next tick. It now waits
30 s; the waits after other refusals are unchanged.

AI disclosure: prepared with AI assistance (OpenAI Codex and Claude by Anthropic).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84ffeac4-89b8-4d7c-9bac-49868347b69e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@MattF42
MattF42 merged commit 2d7eda7 into HoosatNetwork:2.19.2 Nov 30, 2026
5 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.

2 participants