firo used serials cached electrumx fix

This commit is contained in:
julian 2023-12-04 10:48:09 -06:00
parent c51ccd33ac
commit 747565fa16

View file

@ -9,6 +9,7 @@
*/
import 'dart:convert';
import 'dart:math';
import 'package:stackwallet/db/hive/db.dart';
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
@ -167,8 +168,10 @@ class CachedElectrumX {
Set<String> cachedSerials =
_list == null ? {} : List<String>.from(_list).toSet();
final startNumber =
cachedSerials.length - 10; // 10 being some arbitrary buffer
startNumber = max(
max(0, startNumber),
cachedSerials.length - 100, // 100 being some arbitrary buffer
);
final serials = await electrumXClient.getUsedCoinSerials(
startNumber: startNumber,