diff --git a/Plugins/BTCPayServer.Plugins.NIP05/BTCPayServer.Plugins.NIP05.csproj b/Plugins/BTCPayServer.Plugins.NIP05/BTCPayServer.Plugins.NIP05.csproj index 2bc1dec..384be65 100644 --- a/Plugins/BTCPayServer.Plugins.NIP05/BTCPayServer.Plugins.NIP05.csproj +++ b/Plugins/BTCPayServer.Plugins.NIP05/BTCPayServer.Plugins.NIP05.csproj @@ -11,7 +11,7 @@ Nostr NIP5 addresses, Zap support, Nostr Wallet Connect Lightning support - 1.1.17 + 1.1.18 true @@ -36,7 +36,7 @@ - + diff --git a/Plugins/BTCPayServer.Plugins.NIP05/NostrClientWrapper.cs b/Plugins/BTCPayServer.Plugins.NIP05/NostrClientWrapper.cs index 27efd89..b502388 100644 --- a/Plugins/BTCPayServer.Plugins.NIP05/NostrClientWrapper.cs +++ b/Plugins/BTCPayServer.Plugins.NIP05/NostrClientWrapper.cs @@ -1,48 +1,48 @@ -using System; -using System.Threading; -using NNostr.Client; - -namespace BTCPayServer.Plugins.NIP05; - -public class NostrClientWrapper : IDisposable -{ - public INostrClient Client { get; private set; } - private int _usageCount = 0; - private bool _isDisposed = false; - private DateTimeOffset _lastUsed; - - public NostrClientWrapper(INostrClient client) - { - Client = client; - _lastUsed = DateTimeOffset.UtcNow; - } - - public void IncrementUsage() - { - _lastUsed = DateTimeOffset.UtcNow; - Interlocked.Increment(ref _usageCount); - } - - public void DecrementUsage() - { - _lastUsed = DateTimeOffset.UtcNow; - if (Interlocked.Decrement(ref _usageCount) == 0 && IsExpired()) - { - Dispose(); - } - } - - public bool IsExpired() - { - return DateTimeOffset.UtcNow - _lastUsed > TimeSpan.FromMinutes(5); - } - - public void Dispose() - { - if (!_isDisposed) - { - Client.Dispose(); - _isDisposed = true; - } - } -} \ No newline at end of file +// using System; +// using System.Threading; +// using NNostr.Client; +// +// namespace BTCPayServer.Plugins.NIP05; +// +// public class NostrClientWrapper : IDisposable +// { +// public INostrClient Client { get; private set; } +// private int _usageCount = 0; +// private bool _isDisposed = false; +// private DateTimeOffset _lastUsed; +// +// public NostrClientWrapper(INostrClient client) +// { +// Client = client; +// _lastUsed = DateTimeOffset.UtcNow; +// } +// +// public void IncrementUsage() +// { +// _lastUsed = DateTimeOffset.UtcNow; +// Interlocked.Increment(ref _usageCount); +// } +// +// public void DecrementUsage() +// { +// _lastUsed = DateTimeOffset.UtcNow; +// if (Interlocked.Decrement(ref _usageCount) == 0 && IsExpired()) +// { +// Dispose(); +// } +// } +// +// public bool IsExpired() +// { +// return DateTimeOffset.UtcNow - _lastUsed > TimeSpan.FromMinutes(5); +// } +// +// public void Dispose() +// { +// if (!_isDisposed) +// { +// Client.Dispose(); +// _isDisposed = true; +// } +// } +// } \ No newline at end of file diff --git a/Plugins/BTCPayServer.Plugins.Wabisabi/BTCPayServer.Plugins.Wabisabi.csproj b/Plugins/BTCPayServer.Plugins.Wabisabi/BTCPayServer.Plugins.Wabisabi.csproj index 210d5e6..3b21aeb 100644 --- a/Plugins/BTCPayServer.Plugins.Wabisabi/BTCPayServer.Plugins.Wabisabi.csproj +++ b/Plugins/BTCPayServer.Plugins.Wabisabi/BTCPayServer.Plugins.Wabisabi.csproj @@ -44,7 +44,7 @@ - +