From 278f2f9968ee5d3ae308467efc1ee32a9391196a Mon Sep 17 00:00:00 2001 From: _XxFedexX_ <_xxfedexx_@noreply.gitgud.wownero.nl> Date: Mon, 23 Jan 2023 05:15:40 +0000 Subject: [PATCH] Restore pool mining (#446) This PR restores pool mining. Co-authored-by: XfedeX Reviewed-on: https://git.wownero.com/wownero/wownero/pulls/446 Co-authored-by: _XxFedexX_ <_xxfedexx_@noreply.gitgud.wownero.nl> Co-committed-by: _XxFedexX_ <_xxfedexx_@noreply.gitgud.wownero.nl> --- src/cryptonote_basic/cryptonote_basic.h | 2 +- src/cryptonote_basic/cryptonote_boost_serialization.h | 2 +- src/cryptonote_basic/miner.cpp | 2 +- src/cryptonote_config.h | 1 + src/cryptonote_core/blockchain.cpp | 2 +- src/rpc/core_rpc_server.cpp | 2 +- src/rpc/daemon_handler.cpp | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h index f8b4045b3..451ff1d90 100644 --- a/src/cryptonote_basic/cryptonote_basic.h +++ b/src/cryptonote_basic/cryptonote_basic.h @@ -470,7 +470,7 @@ namespace cryptonote VARINT_FIELD(timestamp) FIELD(prev_id) FIELD(nonce) - if (major_version >= BLOCK_HEADER_MINER_SIG) + if (major_version >= BLOCK_HEADER_MINER_SIG && major_version < REMOVED_BLOCK_HEADER_MINER_SIG) { FIELD(signature) FIELD(vote) diff --git a/src/cryptonote_basic/cryptonote_boost_serialization.h b/src/cryptonote_basic/cryptonote_boost_serialization.h index b2a42a038..bbc56bd3c 100644 --- a/src/cryptonote_basic/cryptonote_boost_serialization.h +++ b/src/cryptonote_basic/cryptonote_boost_serialization.h @@ -196,7 +196,7 @@ namespace boost a & b.timestamp; a & b.prev_id; a & b.nonce; - if (b.major_version >= BLOCK_HEADER_MINER_SIG) + if (b.major_version >= BLOCK_HEADER_MINER_SIG && b.major_version < REMOVED_BLOCK_HEADER_MINER_SIG) { a & b.signature; a & b.vote; diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp index 8452b53c4..c105c6157 100644 --- a/src/cryptonote_basic/miner.cpp +++ b/src/cryptonote_basic/miner.cpp @@ -609,7 +609,7 @@ namespace cryptonote b.nonce = nonce; // Miner Block Header Signing - if (b.major_version >= BLOCK_HEADER_MINER_SIG) + if (b.major_version >= BLOCK_HEADER_MINER_SIG && b.major_version < REMOVED_BLOCK_HEADER_MINER_SIG) { // tx key derivation crypto::key_derivation derivation; diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 551bba288..fc5a0aade 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -46,6 +46,7 @@ #define CURRENT_BLOCK_MAJOR_VERSION 7 #define CURRENT_BLOCK_MINOR_VERSION 7 #define BLOCK_HEADER_MINER_SIG 18 +#define REMOVED_BLOCK_HEADER_MINER_SIG 20 #define CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT_V2 300*2 #define CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT 60*60*2 #define CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE 4 diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index ab9777fa2..f9bddff79 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1397,7 +1397,7 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std: bool Blockchain::prevalidate_miner_transaction(const block& b, uint64_t height, uint8_t hf_version) { // Miner Block Header Signing - if (hf_version >= BLOCK_HEADER_MINER_SIG) + if (hf_version >= BLOCK_HEADER_MINER_SIG && hf_version < REMOVED_BLOCK_HEADER_MINER_SIG) { // sanity checks if (b.miner_tx.vout.size() != 1) diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 52fdbe515..b74b17126 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -2192,7 +2192,7 @@ namespace cryptonote return false; } b.nonce = req.starting_nonce; - if (b.major_version >= BLOCK_HEADER_MINER_SIG) + if (b.major_version >= BLOCK_HEADER_MINER_SIG && b.major_version < REMOVED_BLOCK_HEADER_MINER_SIG) { b.signature = {}; b.vote = 0; diff --git a/src/rpc/daemon_handler.cpp b/src/rpc/daemon_handler.cpp index 5f6a10821..cfa693445 100644 --- a/src/rpc/daemon_handler.cpp +++ b/src/rpc/daemon_handler.cpp @@ -895,7 +895,7 @@ namespace rpc header.minor_version = b.minor_version; header.timestamp = b.timestamp; header.nonce = b.nonce; - if (b.major_version >= BLOCK_HEADER_MINER_SIG) + if (b.major_version >= BLOCK_HEADER_MINER_SIG && b.major_version < REMOVED_BLOCK_HEADER_MINER_SIG) { header.signature = b.signature; header.vote = b.vote;