From 646554d5d6a7b281c7087220b2cac983e27a1ac8 Mon Sep 17 00:00:00 2001 From: Kukks Date: Fri, 4 Aug 2023 14:27:34 +0200 Subject: [PATCH] upd wabi --- .../BTCPayServer.Plugins.Wabisabi.csproj | 2 +- .../BTCPayServer.Plugins.Wabisabi/Smartifier.cs | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Plugins/BTCPayServer.Plugins.Wabisabi/BTCPayServer.Plugins.Wabisabi.csproj b/Plugins/BTCPayServer.Plugins.Wabisabi/BTCPayServer.Plugins.Wabisabi.csproj index 316e9ac..c8fd7ad 100644 --- a/Plugins/BTCPayServer.Plugins.Wabisabi/BTCPayServer.Plugins.Wabisabi.csproj +++ b/Plugins/BTCPayServer.Plugins.Wabisabi/BTCPayServer.Plugins.Wabisabi.csproj @@ -13,7 +13,7 @@ Wabisabi Coinjoin Allows you to integrate your btcpayserver store with coinjoins. - 1.0.48 + 1.0.49 diff --git a/Plugins/BTCPayServer.Plugins.Wabisabi/Smartifier.cs b/Plugins/BTCPayServer.Plugins.Wabisabi/Smartifier.cs index 88192d7..9d7feba 100644 --- a/Plugins/BTCPayServer.Plugins.Wabisabi/Smartifier.cs +++ b/Plugins/BTCPayServer.Plugins.Wabisabi/Smartifier.cs @@ -85,15 +85,22 @@ public class Smartifier potentialMatches.TryAdd(matchedInput, potentialMatchesForInput.ToArray()); foreach (IndexedTxIn potentialMatchForInput in potentialMatchesForInput) { - var ti = await CachedTransactions.GetOrAdd(potentialMatchForInput.PrevOut.Hash, - _explorerClient.GetTransactionAsync(DerivationScheme, - potentialMatchForInput.PrevOut.Hash)); - + TransactionInformation ti = null; + try + { + ti = await CachedTransactions.GetOrAdd(potentialMatchForInput.PrevOut.Hash, + _explorerClient.GetTransactionAsync(DerivationScheme, + potentialMatchForInput.PrevOut.Hash)); + } + catch (Exception e) + { + CachedTransactions.Remove(potentialMatchForInput.PrevOut.Hash, out _); + } if (ti is not null) { MatchedOutput found = ti.Outputs.Find(output => matchedInput.Index == output.Index && - matchedInput.Value == output.Value && + matchedInput.Value.Equals(output.Value) && matchedInput.KeyPath == output.KeyPath && matchedInput.ScriptPubKey == output.ScriptPubKey );