From 262964429f8811cdce8be89a662615ef055b2bfe Mon Sep 17 00:00:00 2001 From: U-Zyn Chua Date: Thu, 19 Dec 2019 18:42:46 +0000 Subject: [PATCH 1/8] Basic masternode functionality --- src/Makefile.am | 7 + src/Makefile.bench.include | 1 + src/consensus/tx_verify.cpp | 9 +- src/consensus/tx_verify.h | 3 +- src/init.cpp | 9 +- src/interfaces/chain.cpp | 7 + src/interfaces/chain.h | 2 + src/masternodes/masternodes.cpp | 411 +++++++++++++++++++++++++++++ src/masternodes/masternodes.h | 330 ++++++++++++++++++++++++ src/masternodes/mn_checks.cpp | 135 ++++++++++ src/masternodes/mn_checks.h | 22 ++ src/masternodes/mn_rpc.cpp | 443 ++++++++++++++++++++++++++++++++ src/masternodes/mn_txdb.cpp | 174 +++++++++++++ src/masternodes/mn_txdb.h | 111 ++++++++ src/net_processing.cpp | 5 +- src/rpc/client.cpp | 2 + src/rpc/register.h | 3 + src/txmempool.cpp | 10 +- src/txmempool.h | 3 +- src/validation.cpp | 81 ++++-- src/validation.h | 12 +- src/wallet/wallet.cpp | 6 + 22 files changed, 1750 insertions(+), 36 deletions(-) create mode 100644 src/masternodes/masternodes.cpp create mode 100644 src/masternodes/masternodes.h create mode 100644 src/masternodes/mn_checks.cpp create mode 100644 src/masternodes/mn_checks.h create mode 100644 src/masternodes/mn_rpc.cpp create mode 100644 src/masternodes/mn_txdb.cpp create mode 100644 src/masternodes/mn_txdb.h diff --git a/src/Makefile.am b/src/Makefile.am index 9a071b0031d..1451953f3b6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -146,6 +146,9 @@ BITCOIN_CORE_H = \ dbwrapper.h \ limitedmap.h \ logging.h \ + masternodes/masternodes.h \ + masternodes/mn_checks.h \ + masternodes/mn_txdb.h \ memusage.h \ merkleblock.h \ miner.h \ @@ -276,6 +279,10 @@ libbitcoin_server_a_SOURCES = \ interfaces/node.cpp \ init.cpp \ dbwrapper.cpp \ + masternodes/masternodes.cpp \ + masternodes/mn_checks.cpp \ + masternodes/mn_txdb.cpp \ + masternodes/mn_rpc.cpp \ miner.cpp \ net.cpp \ net_processing.cpp \ diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index e421b377a0c..e369a4614d0 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -49,6 +49,7 @@ nodist_bench_bench_bitcoin_SOURCES = $(GENERATED_BENCH_FILES) bench_bench_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CLFAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/ bench_bench_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) bench_bench_bitcoin_LDADD = \ + $(LIBBITCOIN_MN) \ $(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_WALLET) \ $(LIBBITCOIN_SERVER) \ diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index 4b93cae8484..3537f791e7e 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include