From 7293e371654eb401024a5548ed5d497d5cc778e0 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:59:57 +0200 Subject: [PATCH] More hardfork code All block format changes must be a part of hardfork --- src/pool_block_parser.inl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pool_block_parser.inl b/src/pool_block_parser.inl index dd40b50..602c0d3 100644 --- a/src/pool_block_parser.inl +++ b/src/pool_block_parser.inl @@ -61,10 +61,16 @@ int PoolBlock::deserialize(const uint8_t* data, size_t size, const SideChain& si #define READ_BUF(buf, size) do { if (!read_buf((buf), (size))) return __LINE__; } while(0) - READ_VARINT(m_majorVersion); - if (m_majorVersion > HARDFORK_SUPPORTED_VERSION) return __LINE__; + if (!merge_mining_enabled()) { + READ_BYTE(m_majorVersion); + READ_BYTE(m_minorVersion); + } + else { + READ_VARINT(m_majorVersion); + READ_VARINT(m_minorVersion); + } - READ_VARINT(m_minorVersion); + if (m_majorVersion > HARDFORK_SUPPORTED_VERSION) return __LINE__; if (m_minorVersion < m_majorVersion) return __LINE__; READ_VARINT(m_timestamp);