Skip to content

CW-1193: Refactoring code by implementing batching#2897

Draft
karlbuys wants to merge 45 commits intodevfrom
cw-1193-karls-fns
Draft

CW-1193: Refactoring code by implementing batching#2897
karlbuys wants to merge 45 commits intodevfrom
cw-1193-karls-fns

Conversation

@karlbuys
Copy link
Copy Markdown
Collaborator

Issue Number (if Applicable): Fixes #cw-1193

Description

This PR adds batching to the wallet for all but transaction history right now. The goal of the PR is to improve the speed at which we synchronise our Electrum wallets

Pull Request - Checklist

  • [Yes] Initial Manual Tests Passed
  • [Yes] Double check modified code and verify it with the feature/task requirements
  • [WIP] Format code
  • [WIP] Look for code duplication
  • [WIP] Clear naming for variables and methods
  • [WIP] Manual tests in accessibility mode (TalkBack on Android) passed

This commit creates a batchGetData function for retrieving data from Electrum servers using batching instead of multiple socket writes
Electrum.dart (for some reason) was causing issues related to when it connected to Bitcoin Electrum servers, and where it received whitespace that needed a special RegExp to filter
implements substantial (but not noticeable throttling - we limit our batches to once every two seconds

This is finally a point where it appears we're getting data back without servers nuking our connection
This splits certain queries off to other connections. One day we could make it an isolate, but for now, this is sufficient
karlbuys and others added 12 commits February 9, 2026 19:12
It seems as though we are hitting a connect / disconnect loop that causes the server to ban us now.

While the balance seems to be loaded properly, the sync status needs to still change
This lowers batch size for balance queries, and tweaks parameters to make getting the balance more stable
The idea behind focusing on unspents is that when we start, I want to have those unspents ready and waiting as soon as possible for sending
Going for MVP, will check if scenario covered the way I expect it is
This function replaces older code and checks for multiple vout indexes when getting unspent coins - cherry-pick if mvp not used
@karlbuys karlbuys marked this pull request as draft February 17, 2026 03:31
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