From 2010ef1b440a7896caa902a3616ed099c5d5789b Mon Sep 17 00:00:00 2001 From: cyan Date: Wed, 25 Mar 2026 21:30:39 +0100 Subject: [PATCH] fix: prevent off by one error in ensureMwebAddressUpToIndexExists (#3131) --- cw_bitcoin/lib/litecoin_wallet_addresses.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cw_bitcoin/lib/litecoin_wallet_addresses.dart b/cw_bitcoin/lib/litecoin_wallet_addresses.dart index 147281a7b..737bd41f4 100644 --- a/cw_bitcoin/lib/litecoin_wallet_addresses.dart +++ b/cw_bitcoin/lib/litecoin_wallet_addresses.dart @@ -73,7 +73,8 @@ abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses with return List.from(super.allAddresses)..addAll(mwebAddresses); } - Future ensureMwebAddressUpToIndexExists(int index) async { + Future ensureMwebAddressUpToIndexExists(int _index) async { + final index = _index + 1; if (Platform.isLinux || Platform.isMacOS || Platform.isWindows) { return null; }