Skip to content

Commit

Permalink
Backport Bitcoin PR#9260: Mrs Peacock in The Library with The Candles…
Browse files Browse the repository at this point in the history
…tick (killed main.{h,cpp}) (#1566)

* Remove orphan state wipe from UnloadBlockIndex.

As orphan state is now "network state", like in
d6ea737,

UnloadBlockIndex is only used during init if we end up reindexing
to clear our block state so that we can start over. However, at
that time no connections have been brought up as CConnman hasn't
been started yet, so all of the network processing state logic is
empty when its called.

* Move network-msg-processing code out of main to its own file

* Rename the remaining main.{h,cpp} to validation.{h,cpp}
  • Loading branch information
OlegGirko authored and UdjinM6 committed Aug 9, 2017
1 parent bcf5455 commit df6d458
Show file tree
Hide file tree
Showing 65 changed files with 2,793 additions and 2,720 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2017)
AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/dashpay/dash/issues],[dashcore])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_SRCDIR([src/validation.cpp])
AC_CONFIG_HEADERS([src/config/dash-config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4])
Expand Down
6 changes: 4 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ BITCOIN_CORE_H = \
keystore.h \
dbwrapper.h \
limitedmap.h \
main.h \
masternode.h \
masternode-payments.h \
masternode-sync.h \
Expand All @@ -138,6 +137,7 @@ BITCOIN_CORE_H = \
messagesigner.h \
miner.h \
net.h \
net_processing.h \
netbase.h \
netfulfilledman.h \
noui.h \
Expand Down Expand Up @@ -183,6 +183,7 @@ BITCOIN_CORE_H = \
utilmoneystr.h \
utilstrencodings.h \
utiltime.h \
validation.h \
validationinterface.h \
version.h \
versionbits.h \
Expand Down Expand Up @@ -223,12 +224,12 @@ libbitcoin_server_a_SOURCES = \
governance-validators.cpp \
governance-vote.cpp \
governance-votedb.cpp \
main.cpp \
merkleblock.cpp \
messagesigner.cpp \
miner.cpp \
net.cpp \
netfulfilledman.cpp \
net_processing.cpp \
noui.cpp \
policy/fees.cpp \
policy/policy.cpp \
Expand All @@ -250,6 +251,7 @@ libbitcoin_server_a_SOURCES = \
torcontrol.cpp \
txdb.cpp \
txmempool.cpp \
validation.cpp \
validationinterface.cpp \
versionbits.cpp \
$(BITCOIN_CORE_H)
Expand Down
2 changes: 1 addition & 1 deletion src/bench/Examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include "main.h"
#include "validation.h"
#include "utiltime.h"

// Sanity test: this should loop ten times, and
Expand Down
2 changes: 1 addition & 1 deletion src/bench/bench_dash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "bench.h"

#include "key.h"
#include "main.h"
#include "validation.h"
#include "util.h"

int
Expand Down
2 changes: 1 addition & 1 deletion src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "chain.h"
#include "chainparams.h"
#include "main.h"
#include "validation.h"
#include "uint256.h"

#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion src/darksend-relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef DARKSEND_RELAY_H
#define DARKSEND_RELAY_H

#include "main.h"
#include "validation.h"
#include "activemasternode.h"
#include "masternodeman.h"

Expand Down
2 changes: 1 addition & 1 deletion src/governance-classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "core_io.h"
#include "governance-classes.h"
#include "init.h"
#include "main.h"
#include "validation.h"
#include "utilstrencodings.h"

#include <boost/algorithm/string.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/governance-misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef GOVERNANCE_MISC_H
#define GOVERNANCE_MISC_H

#include "main.h"
#include "validation.h"
#include "governance.h"
#include "init.h"

Expand Down
2 changes: 1 addition & 1 deletion src/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "governance-object.h"
#include "governance-vote.h"
#include "governance-classes.h"
#include "main.h"
#include "net_processing.h"
#include "masternode.h"
#include "masternode-sync.h"
#include "masternodeman.h"
Expand Down
3 changes: 2 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
#include "httpserver.h"
#include "httprpc.h"
#include "key.h"
#include "main.h"
#include "validation.h"
#include "miner.h"
#include "net.h"
#include "netfulfilledman.h"
#include "net_processing.h"
#include "policy/policy.h"
#include "rpc/server.h"
#include "script/standard.h"
Expand Down
2 changes: 1 addition & 1 deletion src/instantx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "activemasternode.h"
#include "instantx.h"
#include "key.h"
#include "main.h"
#include "validation.h"
#include "masternode-sync.h"
#include "masternodeman.h"
#include "messagesigner.h"
Expand Down
2 changes: 1 addition & 1 deletion src/masternode-payments.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "util.h"
#include "core_io.h"
#include "key.h"
#include "main.h"
#include "masternode.h"
#include "net_processing.h"
#include "utilstrencodings.h"

class CMasternodePayments;
Expand Down
2 changes: 1 addition & 1 deletion src/masternode-sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "activemasternode.h"
#include "checkpoints.h"
#include "governance.h"
#include "main.h"
#include "validation.h"
#include "masternode.h"
#include "masternode-payments.h"
#include "masternode-sync.h"
Expand Down
2 changes: 1 addition & 1 deletion src/masternode.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define MASTERNODE_H

#include "key.h"
#include "main.h"
#include "validation.h"
#include "net.h"
#include "spork.h"
#include "timedata.h"
Expand Down
2 changes: 1 addition & 1 deletion src/messagesigner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "base58.h"
#include "hash.h"
#include "main.h" // For strMessageMagic
#include "validation.h" // For strMessageMagic
#include "messagesigner.h"
#include "tinyformat.h"
#include "utilstrencodings.h"
Expand Down
2 changes: 1 addition & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "consensus/merkle.h"
#include "consensus/validation.h"
#include "hash.h"
#include "main.h"
#include "validation.h"
#include "net.h"
#include "policy/policy.h"
#include "pow.h"
Expand Down
Loading

0 comments on commit df6d458

Please sign in to comment.