diff --git a/BTCPayServer/App/BTCPayAppHub.cs b/BTCPayServer/App/BTCPayAppHub.cs index b6a6f4f3c..e185f3946 100644 --- a/BTCPayServer/App/BTCPayAppHub.cs +++ b/BTCPayServer/App/BTCPayAppHub.cs @@ -12,6 +12,7 @@ using BTCPayServer.Services; using BTCPayServer.Services.Wallets; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.Logging; using NBitcoin; using NBXplorer.DerivationStrategy; using NBXplorer.Models; @@ -92,18 +93,21 @@ public class BTCPayAppHub : Hub, IBTCPayAppHubServer private readonly BTCPayAppState _appState; private readonly ExplorerClientProvider _explorerClientProvider; private readonly IFeeProviderFactory _feeProviderFactory; + private readonly ILogger _logger; public BTCPayAppHub(BTCPayNetworkProvider btcPayNetworkProvider, NBXplorerDashboard nbXplorerDashboard, BTCPayAppState appState, ExplorerClientProvider explorerClientProvider, - IFeeProviderFactory feeProviderFactory) + IFeeProviderFactory feeProviderFactory, + ILogger logger) { _btcPayNetworkProvider = btcPayNetworkProvider; _nbXplorerDashboard = nbXplorerDashboard; _appState = appState; _explorerClientProvider = explorerClientProvider; _feeProviderFactory = feeProviderFactory; + _logger = logger; } @@ -213,11 +217,14 @@ public class BTCPayAppHub : Hub, IBTCPayAppHubServer public async Task TrackScripts(string identifier, string[] scripts) { + _logger.LogInformation($"Tracking {scripts.Length} scripts for {identifier}"); var explorerClient = _explorerClientProvider.GetExplorerClient( _btcPayNetworkProvider.BTC); var ts = TrackedSource.Parse(identifier,explorerClient.Network ) as GroupTrackedSource; var s = scripts.Select(Script.FromHex).Select(script => script.GetDestinationAddress(explorerClient.Network.NBitcoinNetwork)).Select(address => address.ToString()).ToArray(); await explorerClient.AddGroupAddressAsync(explorerClient.CryptoCode,ts.GroupId, s); + + _logger.LogInformation($"Tracking {scripts.Length} scripts for {identifier} done "); } public async Task UpdatePsbt(string[] identifiers, string psbt) diff --git a/BTCPayServer/App/BTCPayAppState.cs b/BTCPayServer/App/BTCPayAppState.cs index 26bd666af..049d27b25 100644 --- a/BTCPayServer/App/BTCPayAppState.cs +++ b/BTCPayServer/App/BTCPayAppState.cs @@ -228,6 +228,7 @@ public class BTCPayAppState : IHostedService public async Task PaymentUpdate(string identifier, LightningPayment lightningPayment) { + _logger.LogInformation("Payment update for {identifier} {}", identifier); OnPaymentUpdate?.Invoke(this, (identifier, lightningPayment)); }