Skip to content

Feature/cleanuporphanedtransactions#354

Open
liam wants to merge 2 commits intobsv-blockchain:mainfrom
liam:feature/cleanuporphanedtransactions
Open

Feature/cleanuporphanedtransactions#354
liam wants to merge 2 commits intobsv-blockchain:mainfrom
liam:feature/cleanuporphanedtransactions

Conversation

@liam
Copy link
Collaborator

@liam liam commented Jan 6, 2026

No description provided.

@liam liam requested review from freemans13 and ordishs January 6, 2026 13:59
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🤖 Claude Code Review

Status: Complete


Issues Found

Critical

cmd/cleanup-orphaned-external/main.go:100 - Type switch bug
The switch statement case int, int64: will not work as intended in Go. Type switches cannot match multiple types in one case. This should be separate cases or use type conversion.

cmd/cleanup-orphaned-external/main.go:144 - File path assumption
The code assumes external files are named {txID}.tx, but this may not match the actual naming convention used by stores/utxo/. Verify this matches reality to avoid deleting valid records or missing orphans.

Moderate

cmd/cleanup-orphaned-external/main.go:160 - Race condition in progress reporting
Multiple scan goroutines could simultaneously trigger the progress print when scanned % 100000 == 0. While not critical, this could cause duplicate or interleaved output.

cmd/cleanup-orphaned-external/main.go:62 - Nil policy parameter
Using nil for the delete policy may have undefined behavior. Consider using aero.NewWritePolicy() explicitly.


Other Observations

The P2P and block validation changes look reasonable:

  • Cleaner distinction between "malicious" (banned) and "unhealthy" (low reputation) peers
  • Better fallback logic when primary catchup peer fails
  • Improved backoff mechanism when all peers are exhausted

The sync coordinator changes improve resilience by clearing sync attempts when entering backoff, allowing fresh retries after the backoff period expires.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
19.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@liam liam removed request for freemans13 and ordishs January 6, 2026 15:09
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