Make SP scanning, wallet-specific (#2383)

This commit is contained in:
Omar Hatem
2025-07-12 19:58:11 +03:00
committed by GitHub
parent 332d055efe
commit ab5849c57d
13 changed files with 34 additions and 50 deletions
+12 -4
View File
@@ -231,15 +231,14 @@ class CWBitcoin extends Bitcoin {
Box<WalletInfo> walletInfoSource,
Box<UnspentCoinsInfo> unspentCoinSource,
Box<PayjoinSession> payjoinSessionSource,
bool alwaysScan,
bool isDirect) {
return BitcoinWalletService(walletInfoSource, unspentCoinSource,
payjoinSessionSource, alwaysScan, isDirect);
payjoinSessionSource, isDirect);
}
WalletService createLitecoinWalletService(Box<WalletInfo> walletInfoSource,
Box<UnspentCoinsInfo> unspentCoinSource, bool alwaysScan, bool isDirect) {
return LitecoinWalletService(walletInfoSource, unspentCoinSource, alwaysScan, isDirect);
Box<UnspentCoinsInfo> unspentCoinSource, bool isDirect) {
return LitecoinWalletService(walletInfoSource, unspentCoinSource, isDirect);
}
@override
@@ -580,6 +579,15 @@ class CWBitcoin extends Bitcoin {
bitcoinWallet.setSilentPaymentsScanning(active);
}
Future<void> setIsAlwaysScanningSP(Object wallet, bool active) async {
final bitcoinWallet = wallet as ElectrumWallet;
bitcoinWallet.alwaysScan = active;
bitcoinWallet.save();
}
@computed
bool getIsAlwaysScanningSP(Object wallet) => (wallet as ElectrumWallet).alwaysScan ?? false;
@override
bool isTestnet(Object wallet) {
final bitcoinWallet = wallet as ElectrumWallet;