Serialize first seen if mempool time
Resolves
MODIFY
WalletWasabi/JsonConverters/BlockCypherDateTimeOffsetJsonConverter.cs
WalletWasabi/JsonConverters/BlockCypherDateTimeOffsetJsonConverter.cs
@@ -15,6 +15,11 @@ namespace WalletWasabi.JsonConverters
/// <inheritdoc />
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
+ if (reader.Value == null)
+ {
+ return null;
+ }
+
string time = reader.Value.ToString().Trim();
return DateTimeOffset.Parse(time, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
}

MODIFY
WalletWasabi/Models/SmartTransaction.cs
WalletWasabi/Models/SmartTransaction.cs
@@ -33,6 +33,8 @@ namespace WalletWasabi.Models
/// only exists in memory,
/// doesn't affect equality
/// </summary>
+ [JsonProperty]
+ [JsonConverter(typeof(BlockCypherDateTimeOffsetJsonConverter))]
public DateTimeOffset? FirstSeenIfMemPoolTime { get; private set; }
#endregion Members
@@ -44,12 +46,16 @@ namespace WalletWasabi.Models
}
[JsonConstructor]
- public SmartTransaction(Transaction transaction, Height height, string label = "")
+ public SmartTransaction(Transaction transaction, Height height, string label = "", DateTimeOffset? firstSeenIfMemPoolTime = null)
{
Transaction = transaction;
Label = Guard.Correct(label);
SetHeight(height);
+ if (firstSeenIfMemPoolTime != null)
+ {
+ FirstSeenIfMemPoolTime = firstSeenIfMemPoolTime;
+ }
}
public void SetHeight(Height height)

Serialize first seen if mempool time
Resolves https://github.com/zkSNACKs/WalletWasabi/issues/1104