mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Backport Bitcoin PR#9260: Mrs Peacock in The Library with The Candlestick (killed main.{h,cpp}) (#1566)
* Remove orphan state wipe from UnloadBlockIndex.
As orphan state is now "network state", like in
d6ea737be1
,
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}
This commit is contained in:
parent
bcf5455bfd
commit
df6d458b85
@ -7,7 +7,7 @@ define(_CLIENT_VERSION_BUILD, 0)
|
|||||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||||
define(_COPYRIGHT_YEAR, 2017)
|
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_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_HEADERS([src/config/dash-config.h])
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([build-aux/m4])
|
AC_CONFIG_MACRO_DIR([build-aux/m4])
|
||||||
|
@ -127,7 +127,6 @@ BITCOIN_CORE_H = \
|
|||||||
keystore.h \
|
keystore.h \
|
||||||
dbwrapper.h \
|
dbwrapper.h \
|
||||||
limitedmap.h \
|
limitedmap.h \
|
||||||
main.h \
|
|
||||||
masternode.h \
|
masternode.h \
|
||||||
masternode-payments.h \
|
masternode-payments.h \
|
||||||
masternode-sync.h \
|
masternode-sync.h \
|
||||||
@ -138,6 +137,7 @@ BITCOIN_CORE_H = \
|
|||||||
messagesigner.h \
|
messagesigner.h \
|
||||||
miner.h \
|
miner.h \
|
||||||
net.h \
|
net.h \
|
||||||
|
net_processing.h \
|
||||||
netbase.h \
|
netbase.h \
|
||||||
netfulfilledman.h \
|
netfulfilledman.h \
|
||||||
noui.h \
|
noui.h \
|
||||||
@ -183,6 +183,7 @@ BITCOIN_CORE_H = \
|
|||||||
utilmoneystr.h \
|
utilmoneystr.h \
|
||||||
utilstrencodings.h \
|
utilstrencodings.h \
|
||||||
utiltime.h \
|
utiltime.h \
|
||||||
|
validation.h \
|
||||||
validationinterface.h \
|
validationinterface.h \
|
||||||
version.h \
|
version.h \
|
||||||
versionbits.h \
|
versionbits.h \
|
||||||
@ -223,12 +224,12 @@ libbitcoin_server_a_SOURCES = \
|
|||||||
governance-validators.cpp \
|
governance-validators.cpp \
|
||||||
governance-vote.cpp \
|
governance-vote.cpp \
|
||||||
governance-votedb.cpp \
|
governance-votedb.cpp \
|
||||||
main.cpp \
|
|
||||||
merkleblock.cpp \
|
merkleblock.cpp \
|
||||||
messagesigner.cpp \
|
messagesigner.cpp \
|
||||||
miner.cpp \
|
miner.cpp \
|
||||||
net.cpp \
|
net.cpp \
|
||||||
netfulfilledman.cpp \
|
netfulfilledman.cpp \
|
||||||
|
net_processing.cpp \
|
||||||
noui.cpp \
|
noui.cpp \
|
||||||
policy/fees.cpp \
|
policy/fees.cpp \
|
||||||
policy/policy.cpp \
|
policy/policy.cpp \
|
||||||
@ -250,6 +251,7 @@ libbitcoin_server_a_SOURCES = \
|
|||||||
torcontrol.cpp \
|
torcontrol.cpp \
|
||||||
txdb.cpp \
|
txdb.cpp \
|
||||||
txmempool.cpp \
|
txmempool.cpp \
|
||||||
|
validation.cpp \
|
||||||
validationinterface.cpp \
|
validationinterface.cpp \
|
||||||
versionbits.cpp \
|
versionbits.cpp \
|
||||||
$(BITCOIN_CORE_H)
|
$(BITCOIN_CORE_H)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "utiltime.h"
|
#include "utiltime.h"
|
||||||
|
|
||||||
// Sanity test: this should loop ten times, and
|
// Sanity test: this should loop ten times, and
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "bench.h"
|
#include "bench.h"
|
||||||
|
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "chain.h"
|
#include "chain.h"
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#ifndef DARKSEND_RELAY_H
|
#ifndef DARKSEND_RELAY_H
|
||||||
#define DARKSEND_RELAY_H
|
#define DARKSEND_RELAY_H
|
||||||
|
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "activemasternode.h"
|
#include "activemasternode.h"
|
||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "core_io.h"
|
#include "core_io.h"
|
||||||
#include "governance-classes.h"
|
#include "governance-classes.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#ifndef GOVERNANCE_MISC_H
|
#ifndef GOVERNANCE_MISC_H
|
||||||
#define GOVERNANCE_MISC_H
|
#define GOVERNANCE_MISC_H
|
||||||
|
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "governance.h"
|
#include "governance.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "governance-object.h"
|
#include "governance-object.h"
|
||||||
#include "governance-vote.h"
|
#include "governance-vote.h"
|
||||||
#include "governance-classes.h"
|
#include "governance-classes.h"
|
||||||
#include "main.h"
|
#include "net_processing.h"
|
||||||
#include "masternode.h"
|
#include "masternode.h"
|
||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
|
@ -20,10 +20,11 @@
|
|||||||
#include "httpserver.h"
|
#include "httpserver.h"
|
||||||
#include "httprpc.h"
|
#include "httprpc.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "miner.h"
|
#include "miner.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "netfulfilledman.h"
|
#include "netfulfilledman.h"
|
||||||
|
#include "net_processing.h"
|
||||||
#include "policy/policy.h"
|
#include "policy/policy.h"
|
||||||
#include "rpc/server.h"
|
#include "rpc/server.h"
|
||||||
#include "script/standard.h"
|
#include "script/standard.h"
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "activemasternode.h"
|
#include "activemasternode.h"
|
||||||
#include "instantx.h"
|
#include "instantx.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
#include "messagesigner.h"
|
#include "messagesigner.h"
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "core_io.h"
|
#include "core_io.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "main.h"
|
|
||||||
#include "masternode.h"
|
#include "masternode.h"
|
||||||
|
#include "net_processing.h"
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
|
|
||||||
class CMasternodePayments;
|
class CMasternodePayments;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "activemasternode.h"
|
#include "activemasternode.h"
|
||||||
#include "checkpoints.h"
|
#include "checkpoints.h"
|
||||||
#include "governance.h"
|
#include "governance.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "masternode.h"
|
#include "masternode.h"
|
||||||
#include "masternode-payments.h"
|
#include "masternode-payments.h"
|
||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#define MASTERNODE_H
|
#define MASTERNODE_H
|
||||||
|
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "spork.h"
|
#include "spork.h"
|
||||||
#include "timedata.h"
|
#include "timedata.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "main.h" // For strMessageMagic
|
#include "validation.h" // For strMessageMagic
|
||||||
#include "messagesigner.h"
|
#include "messagesigner.h"
|
||||||
#include "tinyformat.h"
|
#include "tinyformat.h"
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "consensus/merkle.h"
|
#include "consensus/merkle.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "policy/policy.h"
|
#include "policy/policy.h"
|
||||||
#include "pow.h"
|
#include "pow.h"
|
||||||
|
2655
src/net_processing.cpp
Normal file
2655
src/net_processing.cpp
Normal file
File diff suppressed because it is too large
Load Diff
50
src/net_processing.h
Normal file
50
src/net_processing.h
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||||
|
// Copyright (c) 2009-2015 The Bitcoin Core developers
|
||||||
|
// Distributed under the MIT software license, see the accompanying
|
||||||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#ifndef BITCOIN_NET_PROCESSING_H
|
||||||
|
#define BITCOIN_NET_PROCESSING_H
|
||||||
|
|
||||||
|
#include "net.h"
|
||||||
|
#include "validationinterface.h"
|
||||||
|
|
||||||
|
/** Register with a network node to receive its signals */
|
||||||
|
void RegisterNodeSignals(CNodeSignals& nodeSignals);
|
||||||
|
/** Unregister a network node */
|
||||||
|
void UnregisterNodeSignals(CNodeSignals& nodeSignals);
|
||||||
|
|
||||||
|
class PeerLogicValidation : public CValidationInterface {
|
||||||
|
private:
|
||||||
|
CConnman* connman;
|
||||||
|
|
||||||
|
public:
|
||||||
|
PeerLogicValidation(CConnman* connmanIn);
|
||||||
|
|
||||||
|
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
|
||||||
|
virtual void BlockChecked(const CBlock& block, const CValidationState& state);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CNodeStateStats {
|
||||||
|
int nMisbehavior;
|
||||||
|
int nSyncHeight;
|
||||||
|
int nCommonHeight;
|
||||||
|
std::vector<int> vHeightInFlight;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Get statistics from node state */
|
||||||
|
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);
|
||||||
|
/** Increase a node's misbehavior score. */
|
||||||
|
void Misbehaving(NodeId nodeid, int howmuch);
|
||||||
|
|
||||||
|
/** Process protocol messages received from a given node */
|
||||||
|
bool ProcessMessages(CNode* pfrom, CConnman& connman);
|
||||||
|
/**
|
||||||
|
* Send queued protocol messages to be sent to a give node.
|
||||||
|
*
|
||||||
|
* @param[in] pto The node which we are sending messages to.
|
||||||
|
* @param[in] connman The connection manager for that node.
|
||||||
|
*/
|
||||||
|
bool SendMessages(CNode* pto, CConnman& connman);
|
||||||
|
|
||||||
|
#endif // BITCOIN_NET_PROCESSING_H
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "policy/policy.h"
|
#include "policy/policy.h"
|
||||||
|
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "tinyformat.h"
|
#include "tinyformat.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "checkpoints.h"
|
#include "checkpoints.h"
|
||||||
#include "clientversion.h"
|
#include "clientversion.h"
|
||||||
|
#include "validation.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "txmempool.h"
|
#include "txmempool.h"
|
||||||
#include "ui_interface.h"
|
#include "ui_interface.h"
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "coincontrol.h"
|
#include "coincontrol.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h" // For minRelayTxFee
|
#include "validation.h" // For minRelayTxFee
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
|
|
||||||
#include "instantx.h"
|
#include "instantx.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "primitives/transaction.h"
|
#include "primitives/transaction.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h" // For minRelayTxFee
|
#include "validation.h" // For minRelayTxFee
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include "script/script.h"
|
#include "script/script.h"
|
||||||
#include "script/standard.h"
|
#include "script/standard.h"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "guiutil.h"
|
#include "guiutil.h"
|
||||||
#include "optionsmodel.h"
|
#include "optionsmodel.h"
|
||||||
|
|
||||||
#include "main.h" // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS
|
#include "validation.h" // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS
|
||||||
#include "netbase.h"
|
#include "netbase.h"
|
||||||
#include "txdb.h" // for -dbcache defaults
|
#include "txdb.h" // for -dbcache defaults
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "amount.h"
|
#include "amount.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h" // For DEFAULT_SCRIPTCHECK_THREADS
|
#include "validation.h" // For DEFAULT_SCRIPTCHECK_THREADS
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "txdb.h" // for -dbcache defaults
|
#include "txdb.h" // for -dbcache defaults
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "main.h" // For minRelayTxFee
|
#include "validation.h" // For minRelayTxFee
|
||||||
#include "ui_interface.h"
|
#include "ui_interface.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "guiconstants.h"
|
#include "guiconstants.h"
|
||||||
#include "guiutil.h"
|
#include "guiutil.h"
|
||||||
|
|
||||||
|
#include "validation.h" // for cs_main
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#ifndef BITCOIN_QT_PEERTABLEMODEL_H
|
#ifndef BITCOIN_QT_PEERTABLEMODEL_H
|
||||||
#define BITCOIN_QT_PEERTABLEMODEL_H
|
#define BITCOIN_QT_PEERTABLEMODEL_H
|
||||||
|
|
||||||
#include "main.h" // For CNodeStateStats
|
#include "net_processing.h" // For CNodeStateStats
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "coincontrol.h"
|
#include "coincontrol.h"
|
||||||
#include "main.h" // mempool and minRelayTxFee
|
#include "validation.h" // mempool and minRelayTxFee
|
||||||
#include "ui_interface.h"
|
#include "ui_interface.h"
|
||||||
#include "txmempool.h"
|
#include "txmempool.h"
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h" // For strMessageMagic
|
#include "validation.h" // For strMessageMagic
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "consensus/consensus.h"
|
#include "consensus/consensus.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "script/script.h"
|
#include "script/script.h"
|
||||||
#include "timedata.h"
|
#include "timedata.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "consensus/consensus.h"
|
#include "consensus/consensus.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "timedata.h"
|
#include "timedata.h"
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "walletmodel.h"
|
#include "walletmodel.h"
|
||||||
|
|
||||||
#include "core_io.h"
|
#include "core_io.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
@ -14,9 +14,11 @@
|
|||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "keystore.h"
|
#include "keystore.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
|
#include "net.h" // for g_connman
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
#include "ui_interface.h"
|
#include "ui_interface.h"
|
||||||
|
#include "util.h" // for GetBoolArg
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
#include "wallet/walletdb.h" // for BackupWallet
|
#include "wallet/walletdb.h" // for BackupWallet
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "primitives/block.h"
|
#include "primitives/block.h"
|
||||||
#include "primitives/transaction.h"
|
#include "primitives/transaction.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "httpserver.h"
|
#include "httpserver.h"
|
||||||
#include "rpc/server.h"
|
#include "rpc/server.h"
|
||||||
#include "streams.h"
|
#include "streams.h"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "checkpoints.h"
|
#include "checkpoints.h"
|
||||||
#include "coins.h"
|
#include "coins.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "policy/policy.h"
|
#include "policy/policy.h"
|
||||||
#include "primitives/transaction.h"
|
#include "primitives/transaction.h"
|
||||||
#include "rpc/server.h"
|
#include "rpc/server.h"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "governance-classes.h"
|
#include "governance-classes.h"
|
||||||
#include "governance-validators.h"
|
#include "governance-validators.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "masternode.h"
|
#include "masternode.h"
|
||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
#include "masternodeconfig.h"
|
#include "masternodeconfig.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "activemasternode.h"
|
#include "activemasternode.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "masternode-payments.h"
|
#include "masternode-payments.h"
|
||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
#include "masternodeconfig.h"
|
#include "masternodeconfig.h"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "core_io.h"
|
#include "core_io.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "miner.h"
|
#include "miner.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "pow.h"
|
#include "pow.h"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "clientversion.h"
|
#include "clientversion.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "netbase.h"
|
#include "netbase.h"
|
||||||
#include "rpc/server.h"
|
#include "rpc/server.h"
|
||||||
|
@ -7,8 +7,9 @@
|
|||||||
|
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "clientversion.h"
|
#include "clientversion.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
#include "net_processing.h"
|
||||||
#include "netbase.h"
|
#include "netbase.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "core_io.h"
|
#include "core_io.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "keystore.h"
|
#include "keystore.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "merkleblock.h"
|
#include "merkleblock.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "policy/policy.h"
|
#include "policy/policy.h"
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "messagesigner.h"
|
#include "messagesigner.h"
|
||||||
|
#include "net_processing.h"
|
||||||
#include "spork.h"
|
#include "spork.h"
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "keystore.h"
|
#include "keystore.h"
|
||||||
#include "main.h"
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
#include "net_processing.h"
|
||||||
#include "pow.h"
|
#include "pow.h"
|
||||||
#include "script/sign.h"
|
#include "script/sign.h"
|
||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "clientversion.h"
|
#include "clientversion.h"
|
||||||
#include "data/alertTests.raw.h"
|
#include "data/alertTests.raw.h"
|
||||||
#include "main.h" // For PartitionCheck
|
|
||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
#include "streams.h"
|
#include "streams.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "clientversion.h"
|
#include "clientversion.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "main.h" // For CheckBlock
|
#include "validation.h" // For CheckBlock
|
||||||
#include "primitives/block.h"
|
#include "primitives/block.h"
|
||||||
#include "test/test_dash.h"
|
#include "test/test_dash.h"
|
||||||
#include "utiltime.h"
|
#include "utiltime.h"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
#include "test/test_dash.h"
|
#include "test/test_dash.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
|
#include "net.h"
|
||||||
|
|
||||||
#include "test/test_dash.h"
|
#include "test/test_dash.h"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "consensus/consensus.h"
|
#include "consensus/consensus.h"
|
||||||
#include "consensus/merkle.h"
|
#include "consensus/merkle.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "masternode-payments.h"
|
#include "masternode-payments.h"
|
||||||
#include "miner.h"
|
#include "miner.h"
|
||||||
#include "pubkey.h"
|
#include "pubkey.h"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "rpc/client.h"
|
#include "rpc/client.h"
|
||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
|
|
||||||
#include "test/test_dash.h"
|
#include "test/test_dash.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "keystore.h"
|
#include "keystore.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "policy/policy.h"
|
#include "policy/policy.h"
|
||||||
#include "script/script.h"
|
#include "script/script.h"
|
||||||
#include "script/script_error.h"
|
#include "script/script_error.h"
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "data/sighash.json.h"
|
#include "data/sighash.json.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "main.h" // For CheckTransaction
|
#include "validation.h" // For CheckTransaction
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "script/interpreter.h"
|
#include "script/interpreter.h"
|
||||||
#include "script/script.h"
|
#include "script/script.h"
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
#include "consensus/consensus.h"
|
#include "consensus/consensus.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "miner.h"
|
#include "miner.h"
|
||||||
|
#include "net_processing.h"
|
||||||
#include "pubkey.h"
|
#include "pubkey.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "txdb.h"
|
#include "txdb.h"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "core_io.h"
|
#include "core_io.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "keystore.h"
|
#include "keystore.h"
|
||||||
#include "main.h" // For CheckTransaction
|
#include "validation.h" // For CheckTransaction
|
||||||
#include "policy/policy.h"
|
#include "policy/policy.h"
|
||||||
#include "script/script.h"
|
#include "script/script.h"
|
||||||
#include "script/script_error.h"
|
#include "script/script_error.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "miner.h"
|
#include "miner.h"
|
||||||
#include "pubkey.h"
|
#include "pubkey.h"
|
||||||
#include "txmempool.h"
|
#include "txmempool.h"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "versionbits.h"
|
#include "versionbits.h"
|
||||||
#include "test/test_dash.h"
|
#include "test/test_dash.h"
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "consensus/params.h"
|
#include "consensus/params.h"
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "chain.h"
|
#include "chain.h"
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "pow.h"
|
#include "pow.h"
|
||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
|
|
||||||
|
@ -8,8 +8,9 @@
|
|||||||
#include "clientversion.h"
|
#include "clientversion.h"
|
||||||
#include "consensus/consensus.h"
|
#include "consensus/consensus.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "policy/fees.h"
|
#include "policy/fees.h"
|
||||||
|
#include "random.h"
|
||||||
#include "streams.h"
|
#include "streams.h"
|
||||||
#include "timedata.h"
|
#include "timedata.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -4,8 +4,8 @@
|
|||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#ifndef BITCOIN_MAIN_H
|
#ifndef BITCOIN_VALIDATION_H
|
||||||
#define BITCOIN_MAIN_H
|
#define BITCOIN_VALIDATION_H
|
||||||
|
|
||||||
#if defined(HAVE_CONFIG_H)
|
#if defined(HAVE_CONFIG_H)
|
||||||
#include "config/dash-config.h"
|
#include "config/dash-config.h"
|
||||||
@ -14,10 +14,9 @@
|
|||||||
#include "amount.h"
|
#include "amount.h"
|
||||||
#include "chain.h"
|
#include "chain.h"
|
||||||
#include "coins.h"
|
#include "coins.h"
|
||||||
#include "net.h"
|
#include "protocol.h" // For CMessageHeader::MessageStartChars
|
||||||
#include "script/script_error.h"
|
#include "script/script_error.h"
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
#include "validationinterface.h"
|
|
||||||
#include "versionbits.h"
|
#include "versionbits.h"
|
||||||
#include "spentindex.h"
|
#include "spentindex.h"
|
||||||
|
|
||||||
@ -30,7 +29,10 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
#include <boost/filesystem/path.hpp>
|
||||||
|
|
||||||
class CBlockIndex;
|
class CBlockIndex;
|
||||||
class CBlockTreeDB;
|
class CBlockTreeDB;
|
||||||
@ -855,45 +857,4 @@ static const unsigned int REJECT_ALREADY_KNOWN = 0x101;
|
|||||||
/** Transaction conflicts with a transaction already known */
|
/** Transaction conflicts with a transaction already known */
|
||||||
static const unsigned int REJECT_CONFLICT = 0x102;
|
static const unsigned int REJECT_CONFLICT = 0x102;
|
||||||
|
|
||||||
// The following things handle network-processing logic
|
#endif // BITCOIN_VALIDATION_H
|
||||||
// (and should be moved to a separate file)
|
|
||||||
|
|
||||||
/** Register with a network node to receive its signals */
|
|
||||||
void RegisterNodeSignals(CNodeSignals& nodeSignals);
|
|
||||||
/** Unregister a network node */
|
|
||||||
void UnregisterNodeSignals(CNodeSignals& nodeSignals);
|
|
||||||
|
|
||||||
class PeerLogicValidation : public CValidationInterface {
|
|
||||||
private:
|
|
||||||
CConnman* connman;
|
|
||||||
|
|
||||||
public:
|
|
||||||
PeerLogicValidation(CConnman* connmanIn);
|
|
||||||
|
|
||||||
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
|
|
||||||
virtual void BlockChecked(const CBlock& block, const CValidationState& state);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CNodeStateStats {
|
|
||||||
int nMisbehavior;
|
|
||||||
int nSyncHeight;
|
|
||||||
int nCommonHeight;
|
|
||||||
std::vector<int> vHeightInFlight;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Get statistics from node state */
|
|
||||||
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);
|
|
||||||
/** Increase a node's misbehavior score. */
|
|
||||||
void Misbehaving(NodeId nodeid, int howmuch);
|
|
||||||
|
|
||||||
/** Process protocol messages received from a given node */
|
|
||||||
bool ProcessMessages(CNode* pfrom, CConnman& connman);
|
|
||||||
/**
|
|
||||||
* Send queued protocol messages to be sent to a give node.
|
|
||||||
*
|
|
||||||
* @param[in] pto The node which we are sending messages to.
|
|
||||||
* @param[in] connman The connection manager for that node.
|
|
||||||
*/
|
|
||||||
bool SendMessages(CNode* pto, CConnman& connman);
|
|
||||||
|
|
||||||
#endif // BITCOIN_MAIN_H
|
|
@ -7,7 +7,7 @@
|
|||||||
#include "chain.h"
|
#include "chain.h"
|
||||||
#include "rpc/server.h"
|
#include "rpc/server.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "script/script.h"
|
#include "script/script.h"
|
||||||
#include "script/standard.h"
|
#include "script/standard.h"
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "chain.h"
|
#include "chain.h"
|
||||||
#include "core_io.h"
|
#include "core_io.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "netbase.h"
|
#include "netbase.h"
|
||||||
#include "policy/rbf.h"
|
#include "policy/rbf.h"
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "keystore.h"
|
#include "keystore.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "policy/policy.h"
|
#include "policy/policy.h"
|
||||||
#include "primitives/block.h"
|
#include "primitives/block.h"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
#include "main.h" // For CheckTransaction
|
#include "validation.h" // For CheckTransaction
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "zmqpublishnotifier.h"
|
#include "zmqpublishnotifier.h"
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "streams.h"
|
#include "streams.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
|
#include "streams.h"
|
||||||
#include "zmqpublishnotifier.h"
|
#include "zmqpublishnotifier.h"
|
||||||
#include "main.h"
|
#include "validation.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static std::multimap<std::string, CZMQAbstractPublishNotifier*> mapPublishNotifiers;
|
static std::multimap<std::string, CZMQAbstractPublishNotifier*> mapPublishNotifiers;
|
||||||
|
Loading…
Reference in New Issue
Block a user