From 9af7edf8b84d13ae96e14d411146d883d233ecf5 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 6 Apr 2020 12:23:56 +0900 Subject: [PATCH] Add comments to explain the Payment's ReceivedTime --- BTCPayServer/Services/Invoices/InvoiceEntity.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/Services/Invoices/InvoiceEntity.cs b/BTCPayServer/Services/Invoices/InvoiceEntity.cs index 294047c8e..c4280e451 100644 --- a/BTCPayServer/Services/Invoices/InvoiceEntity.cs +++ b/BTCPayServer/Services/Invoices/InvoiceEntity.cs @@ -921,10 +921,9 @@ namespace BTCPayServer.Services.Invoices public BTCPayNetworkBase Network { get; set; } public int Version { get; set; } - - // Old invoices use ReceivedTimeSeconds whose precision is not sufficient [Obsolete("Use ReceivedTime instead")] [JsonProperty("receivedTime", DefaultValueHandling = DefaultValueHandling.Ignore)] + // Old invoices were storing the received time in second public DateTimeOffset? ReceivedTimeSeconds { get; set; @@ -932,6 +931,9 @@ namespace BTCPayServer.Services.Invoices [Obsolete("Use ReceivedTime instead")] [JsonProperty("receivedTimeMs", DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonConverter(typeof(DateTimeMilliJsonConverter))] + // Our RBF detection logic depends on properly ordering payments based on + // received time, so we needed a received time in milli to ensure that + // even if payments are separated by less than a second, they would still be ordering public DateTimeOffset? ReceivedTimeMilli { get; set;