Skip to content

Fix networking batch handling, wallet scan timeouts, payments API validation, and startup responsiveness#298

Open
QuickMythril wants to merge 6 commits intoQortal:masterfrom
QuickMythril:bugfix/5.0.7-release
Open

Fix networking batch handling, wallet scan timeouts, payments API validation, and startup responsiveness#298
QuickMythril wants to merge 6 commits intoQortal:masterfrom
QuickMythril:bugfix/5.0.7-release

Conversation

@QuickMythril
Copy link

Summary:

  • Ensure batched GET_BLOCK replies go to all requesters.
  • Process all BLOCK_SUMMARIES_V2 messages without early exit and start schedulers immediately.
  • Validate required params in payments-between API to avoid 500s.
  • Prevent Electrum timeouts from causing under-reported balances; increase history timeout.

Fix GET_BLOCK batching to respond to all requesters

  • File: src/main/java/org/qortal/controller/Controller.java
  • Change: Group GET_BLOCK requests by signature and send cached/fetched/archive/unknown responses to every requesting peer instead of overwriting duplicates.
  • Fixes: Peers asking for the same uncached block at the same time no longer get dropped/responses lost.

Process all BLOCK_SUMMARIES_V2 batch messages

  • File: src/main/java/org/qortal/controller/Controller.java
  • Change: Replace early returns in the BLOCK_SUMMARIES_V2 batch loop with continue, so all queued summaries are processed.
  • Fixes: Peers weren’t getting chain-tip updates if an earlier message failed.

Validate confirmationStatus for payments-between API

  • File: src/main/java/org/qortal/api/resource/TransactionsResource.java
  • Change: Add null check for confirmationStatus and return INVALID_CRITERIA instead of NPE/500.
  • Fixes: Calling /transactions/payments/between without confirmationStatus no longer crashes.

Avoid treating Electrum timeouts as empty history in wallet scan

  • File: src/main/java/org/qortal/crosschain/Bitcoiny.java
  • Change: Introduce tri-state result for async history checks and don’t advance gap on timeouts; only on confirmed empty history.
  • Fixes: Prevents wallet address scanning from stopping early and under-reporting balances when Electrum servers are slow.

Increase history timeout for Electrum address scans

  • File: src/main/java/org/qortal/crosschain/Bitcoiny.java
  • Change: Raise transaction-history check timeout to 15s (keep others at 10s).
  • Fixes: Reduces false timeouts that could still lead to extra scanning or missed addresses.

Start GET_BLOCK and BLOCK_SUMMARIES_V2 schedulers immediately

  • File: src/main/java/org/qortal/controller/Controller.java
  • Change: Remove the 60s initial delay on the batch schedulers (start at 0s, run every second).
  • Fixes: Node responds to block/summary requests immediately after startup instead of waiting a minute.

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