aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-11-03 15:32:02 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-11-03 15:42:50 -0700
commitf518d9ae6aa525c4cd360a16f07a9272cbef558d (patch)
tree335ee53ff19753f10dfd40b42570e0419701e183 /src/validation.h
parentf224cbc3d8f4478d30e121126658c2ab22c6fb90 (diff)
parent8195cb0d7fc4f8699b35aff7a43ed2fb3013608c (diff)
downloadbitcoin-f518d9ae6aa525c4cd360a16f07a9272cbef558d.tar.xz
Merge #11592: 0.15: Backportsv0.15.1rc1
8195cb0d7 rpc: further constrain the libevent workaround (Cory Fields) 34153a7e4 rpc: work-around an upstream libevent bug (Cory Fields) fc308a6cd Add unit test for stale tip checking (Suhas Daftuar) 2ed0647ac Add CConnmanTest to mutate g_connman in tests (João Barbosa) a607a95d8 Connect to an extra outbound peer if our tip is stale (Suhas Daftuar) 459f2db42 Track tip update time and last new block announcement from each peer (Suhas Daftuar) 49bf09018 net: Allow connecting to extra outbound peers (Suhas Daftuar) bb83fe190 Add release notes describing blockmaxweight deprecation (Matt Corallo) 4c82cea99 Use a sensible default for blockmaxweight (Matt Corallo) 7871a7d3b Deprecate confusing blockmaxsize, fix getmininginfo output (Matt Corallo) 6baa317b5 Fix minchainwork test for 0.15 backport (Suhas Daftuar) 55b7abfa8 Make p2p-acceptablock not an extended test (Matt Corallo) 5bec7744d [qa] test that invalid blocks on an invalid chain get a disconnect (Matt Corallo) 92d6105c4 Reject headers building on invalid chains by tracking invalidity (Matt Corallo) 51001d684 Accept unrequested blocks with work equal to our tip (Matt Corallo) c6e4d0ce8 Stop always storing blocks from whitelisted peers (Matt Corallo) e976c36dd Rewrite p2p-acceptblock in preparation for slight behavior changes (Matt Corallo) ec8dedff4 net: Add missing lock in ProcessHeadersMessage(...) (practicalswift) 59b210d9a Disconnect outbound peers relaying invalid headers (Suhas Daftuar) fc966bbd2 moveonly: factor out headers processing into separate function (Suhas Daftuar) e3272242e Add unit test for outbound peer eviction (Suhas Daftuar) 9961abf9e Permit disconnection of outbound peers on bad/slow chains (Suhas Daftuar) bf191a718 Disconnecting from bad outbound peers in IBD (Suhas Daftuar) d570aa429 Fix uninitialized g_connman crash in Shutdown() (MeshCollider) 0a5477c7e net: stop both net/net_processing before destroying them (Cory Fields) b4136f21c net: drop unused connman param (Cory Fields) dc897e53d net: use an interface class rather than signals for message processing (Cory Fields) 8aee55af3 net: pass CConnman via pointer rather than reference (Cory Fields) 6f279652b Rename fAddnode to a more-descriptive "manual_connection" (Matt Corallo) ffb6ea4e5 Add comment explaining forced processing of compact blocks (Suhas Daftuar) 2df65eeb9 qa: add test for minchainwork use in acceptblock (Suhas Daftuar) 3acec3878 Don't process unrequested, low-work blocks (Suhas Daftuar) 0e9d04bf0 [qa] Test nMinimumChainWork (Suhas Daftuar) da4908c3a Allow setting nMinimumChainWork on command line (Suhas Daftuar) 41088795d qa: Remove never used return value of sync_with_ping (MarcoFalke) f3457d0e8 qa: Make tmpdir option an absolute path (MarcoFalke) 9c8006dc3 Avoid opening copied wallet databases simultaneously (Russell Yanofsky) de7053f11 [wallet] Fix leak in CDB constructor (João Barbosa) fd79ed6b2 Ensure backupwallet fails when attempting to backup to source file (Tomas van der Wansem) d94fc336c scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc error (John Newbery) 623de0acb [tests] do not allow assert_raises_message to be called with JSONRPCException (John Newbery) 5b728c8e9 [tests] remove direct testing on JSONRPCException from individual test cases (John Newbery) Pull request description: Tree-SHA512: 9fdb5c47844a899271023d8d445f7fc728e3ad71916490cd9783464684967594b07cda05dd644b722bfcea9fade74d06cfc501e1a68abf118d6d03fbbf7d7707
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/validation.h b/src/validation.h
index edb8eab894..804fb644d9 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -161,7 +161,6 @@ extern CTxMemPool mempool;
typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap;
extern BlockMap mapBlockIndex;
extern uint64_t nLastBlockTx;
-extern uint64_t nLastBlockSize;
extern uint64_t nLastBlockWeight;
extern const std::string strMessageMagic;
extern CWaitableCriticalSection csBestBlock;
@@ -186,6 +185,9 @@ extern bool fEnableReplacement;
/** Block hash whose ancestors we will assume to have valid scripts without checking them. */
extern uint256 hashAssumeValid;
+/** Minimum work we will assume exists on some valid chain. */
+extern arith_uint256 nMinimumChainWork;
+
/** Best header we've seen so far (used for getheaders queries' starting points). */
extern CBlockIndex *pindexBestHeader;
@@ -245,8 +247,9 @@ bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<cons
* @param[out] state This may be set to an Error state if any error occurred processing them
* @param[in] chainparams The params for the chain we want to connect to
* @param[out] ppindex If set, the pointer will be set to point to the last new block index object for the given headers
+ * @param[out] first_invalid First header that fails validation, if one exists
*/
-bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& block, CValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex=nullptr);
+bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& block, CValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex=nullptr, CBlockHeader *first_invalid=nullptr);
/** Check whether enough disk space is available for an incoming block */
bool CheckDiskSpace(uint64_t nAdditionalBytes = 0);