Handle exception data on client side
MODIFY
WalletWasabi/Tor/Http/Extensions/HttpResponseMessageExtensions.cs
WalletWasabi/Tor/Http/Extensions/HttpResponseMessageExtensions.cs
@@ -72,7 +72,7 @@ public static class HttpResponseMessageExtensions
var innerException = error switch
{
{ Type: ProtocolConstants.ProtocolViolationType } => Enum.TryParse<WabiSabiProtocolErrorCode>(error.ErrorCode, out var code)
- ? new WabiSabiProtocolException(code, error.Description)
+ ? new WabiSabiProtocolException(code, error.Description, exceptionData: JsonConvert.DeserializeObject<InputBannedExceptionData>(error.Data))
: new NotSupportedException($"Received WabiSabi protocol exception with unknown '{error.ErrorCode}' error code.\n\tDescription: '{error.Description}'."),
{ Type: "unknown" } => new Exception(error.Description),
_ => null

MODIFY
WalletWasabi/WabiSabi/Client/AliceClient.cs
WalletWasabi/WabiSabi/Client/AliceClient.cs
@@ -109,10 +109,8 @@ public class AliceClient
break;
case WabiSabiProtocolErrorCode.InputBanned or WabiSabiProtocolErrorCode.InputLongBanned:
- var remainingTimeAsString = wpe.Message;
- var remaining = TimeSpan.Parse(remainingTimeAsString);
- coin.BannedUntilUtc = DateTimeOffset.Now + remaining;
- coin.SetIsBanned();
+ var inputBannedExData = wpe.ExceptionData as InputBannedExceptionData;
+ coin.BannedUntilUtc = DateTimeOffset.FromUnixTimeSeconds(inputBannedExData.BannedUntil);
Logger.LogInfo($"{coin.Coin.Outpoint} is banned until {coin.BannedUntilUtc}.");
break;

MODIFY
WalletWasabi/WabiSabi/Models/Error.cs
WalletWasabi/WabiSabi/Models/Error.cs
@@ -3,5 +3,6 @@ namespace WalletWasabi.WabiSabi.Models;
public record Error(
string Type,
string ErrorCode,
- string Description
+ string Description,
+ string Data
);

Handle exception data on client side