From 1182f790c5b019f168a9829515b31a6aeee79a49 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sat, 24 Jun 2023 21:48:29 +0000 Subject: [PATCH] ZEPH support --- src/oracle/pricing_record.cpp | 28 ---------------------------- src/oracle/pricing_record.h | 1 - 2 files changed, 29 deletions(-) diff --git a/src/oracle/pricing_record.cpp b/src/oracle/pricing_record.cpp index 4c9d1cb..a19c6c8 100644 --- a/src/oracle/pricing_record.cpp +++ b/src/oracle/pricing_record.cpp @@ -117,32 +117,4 @@ namespace oracle const pricing_record empty_pr = oracle::pricing_record(); return (*this).equal(empty_pr); } - - // overload for pr validation for block - bool pricing_record::valid(cryptonote::network_type nettype, uint32_t hf_version, uint64_t bl_timestamp, uint64_t last_bl_timestamp) const - { - if (hf_version < HF_VERSION_DJED) { - if (!this->empty()) - return false; - } - - if (this->empty()) - return true; - - // validate the timestmap - if (this->timestamp > bl_timestamp + PRICING_RECORD_VALID_TIME_DIFF_FROM_BLOCK) { - LOG_ERROR("Pricing record timestamp is too far in the future."); - return false; - } - - - - if (this->timestamp <= last_bl_timestamp - PRICING_RECORD_VALID_TIME_DIFF_FROM_BLOCK) { - LOG_ERROR("Pricing record timestamp: " << this->timestamp << ", block timestamp: " << bl_timestamp); - LOG_ERROR("Pricing record timestamp is too old."); - return false; - } - - return true; - } } \ No newline at end of file diff --git a/src/oracle/pricing_record.h b/src/oracle/pricing_record.h index 540697f..b353318 100644 --- a/src/oracle/pricing_record.h +++ b/src/oracle/pricing_record.h @@ -76,7 +76,6 @@ namespace oracle ~pricing_record() = default; bool equal(const pricing_record& other) const noexcept; bool empty() const noexcept; - bool valid(cryptonote::network_type nettype, uint32_t hf_version, uint64_t bl_timestamp, uint64_t last_bl_timestamp) const; pricing_record& operator=(const pricing_record& orig) noexcept; uint64_t operator[](const std::string& asset_type) const;