Skip to content

Commit

Permalink
Add some more logs to the decryption method (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony authored Dec 25, 2024
1 parent 9d033c8 commit 7b76bd8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Angor/Client/Pages/Signatures.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@using Blockcore.NBitcoin.DataEncoders
@using System.Text.Json
@using Angor.Shared.Services
@using System.Security.Cryptography

@inject IJSRuntime JS

Expand Down Expand Up @@ -296,12 +297,21 @@
pendingSignature.AmountToInvest = investorTrx.Outputs.AsIndexedOutputs().Skip(2).Take(investorTrx.Outputs.Count - 3) //Todo get the actual outputs with taproot type
.Sum(_ => _.TxOut.Value.ToUnit(MoneyUnit.BTC));
}
catch (Exception e)
catch (FormatException fe)
{
Logger.LogError(pendingSignature?.TransactionHex ?? e.Message, e);
Logger.LogError("Format error decrypting transaction hex: {TransactionHex}, Exception: {ExceptionMessage}", pendingSignature?.TransactionHex, fe.Message);
pendingSignature.TransactionHex = null;
}
}
catch (CryptographicException ce)
{
Logger.LogError("Cryptographic error decrypting transaction hex: {TransactionHex}, Exception: {ExceptionMessage}", pendingSignature?.TransactionHex, ce.Message);
pendingSignature.TransactionHex = null;
}
catch (Exception e)
{
Logger.LogError("Error decrypting transaction hex: {TransactionHex}, Exception: {ExceptionMessage}", pendingSignature?.TransactionHex, e.Message);
pendingSignature.TransactionHex = null;
} }
Logger.LogDebug($"Calling StateHasChanged in OnAfterRenderAsync");
messagesReceived = false;
StateHasChanged();
Expand Down

0 comments on commit 7b76bd8

Please sign in to comment.