From 7314fe1aac634859323222ee9453f3c7940dfdef Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Fri, 10 Sep 2021 08:25:57 +0100 Subject: [PATCH 1/4] consensus: AuxPoW header Add the AuxPoW header to block storage, without yet adding code to mine or validate mined AuxPoW blocks. --- src/Makefile.am | 2 + src/Makefile.test.include | 1 + src/auxpow.cpp | 215 ++++++++++++ src/auxpow.h | 158 +++++++++ src/chain.cpp | 13 + src/primitives/block.cpp | 13 + src/primitives/block.h | 23 ++ src/rpc/auxpow_miner.cpp | 154 +++++++++ src/rpc/auxpow_miner.h | 107 ++++++ src/test/auxpow_tests.cpp | 609 +++++++++++++++++++++++++++++++++ src/test/merkle_tests.cpp | 2 +- src/test/util/setup_common.cpp | 9 + src/test/util/setup_common.h | 5 + 13 files changed, 1310 insertions(+), 1 deletion(-) create mode 100644 src/auxpow.cpp create mode 100644 src/auxpow.h create mode 100644 src/rpc/auxpow_miner.cpp create mode 100644 src/rpc/auxpow_miner.h create mode 100644 src/test/auxpow_tests.cpp diff --git a/src/Makefile.am b/src/Makefile.am index d275489d512..df7cee91c2b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -107,6 +107,7 @@ BITCOIN_CORE_H = \ addrdb.h \ addrman.h \ attributes.h \ + auxpow.h \ banman.h \ base58.h \ bech32.h \ @@ -489,6 +490,7 @@ libbitcoin_consensus_a_SOURCES = \ libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_common_a_SOURCES = \ + auxpow.cpp \ base58.cpp \ bech32.cpp \ bloom.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 9902f53081f..fc2a0fe1a1c 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -214,6 +214,7 @@ BITCOIN_TESTS =\ test/addrman_tests.cpp \ test/amount_tests.cpp \ test/allocator_tests.cpp \ + test/auxpow_tests.cpp \ test/base32_tests.cpp \ test/base58_tests.cpp \ test/base64_tests.cpp \ diff --git a/src/auxpow.cpp b/src/auxpow.cpp new file mode 100644 index 00000000000..24b13ad5579 --- /dev/null +++ b/src/auxpow.cpp @@ -0,0 +1,215 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 Vince Durham +// Copyright (c) 2009-2014 The Bitcoin developers +// Copyright (c) 2014-2019 Daniel Kraft +// Distributed under the MIT/X11 software license, see the accompanying +// file license.txt or http://www.opensource.org/licenses/mit-license.php. + +#include + +#include +#include +#include +#include +#include