From 45061f40d807d6ac7ff065eba468c7bb0dbb6e7e Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sun, 12 Jun 2022 11:48:21 +0200 Subject: [PATCH] Monero v15 network upgrade support --- src/base/tools/cryptonote/BlockTemplate.cpp | 9 +++++++-- src/base/tools/cryptonote/BlockTemplate.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/base/tools/cryptonote/BlockTemplate.cpp b/src/base/tools/cryptonote/BlockTemplate.cpp index 5a3b4fb7..b4fe4bcf 100644 --- a/src/base/tools/cryptonote/BlockTemplate.cpp +++ b/src/base/tools/cryptonote/BlockTemplate.cpp @@ -228,14 +228,19 @@ bool xmrig::BlockTemplate::parse(bool hashes) ar(m_amount); ar(m_outputType); - // output type must be txout_to_key (2) - if (m_outputType != 2) { + // output type must be txout_to_key (2) or txout_to_tagged_key (3) + if ((m_outputType != 2) && (m_outputType != 3)) { return false; } setOffset(EPH_PUBLIC_KEY_OFFSET, ar.index()); ar(m_ephPublicKey, kKeySize); + + if (m_outputType == 3) { + ar(m_viewTag); + } + ar(m_extraSize); setOffset(TX_EXTRA_OFFSET, ar.index()); diff --git a/src/base/tools/cryptonote/BlockTemplate.h b/src/base/tools/cryptonote/BlockTemplate.h index d6f2de3f..c731aad2 100644 --- a/src/base/tools/cryptonote/BlockTemplate.h +++ b/src/base/tools/cryptonote/BlockTemplate.h @@ -140,6 +140,7 @@ private: uint64_t m_amount = 0; uint8_t m_outputType = 0; Span m_ephPublicKey; + uint8_t m_viewTag = 0; uint64_t m_extraSize = 0; Span m_txExtraNonce; Span m_txMergeMiningTag = 0;