From 82da832368c8aa1d2349b601d40ad42daec5a1e5 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Mon, 17 Feb 2020 15:10:19 +0100 Subject: [PATCH] rpc: Add check for too old timestamps in payment signatures. --- src/rpc/rpc_payment_signature.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rpc/rpc_payment_signature.cpp b/src/rpc/rpc_payment_signature.cpp index 2e8b54b4f..559f3a1e9 100644 --- a/src/rpc/rpc_payment_signature.cpp +++ b/src/rpc/rpc_payment_signature.cpp @@ -102,6 +102,11 @@ namespace cryptonote MDEBUG("Timestamp is in the future"); return false; } + if (ts < now - TIMESTAMP_LEEWAY) + { + MDEBUG("Timestamp is too old"); + return false; + } return true; } }