dash/src
Wladimir J. van der Laan 214046f69b
Merge #10279: Add a CChainState class to validation.cpp to take another step towards clarifying internal interfaces
22fddde Avoid calling GetSerializeSize on each tx in a block if !fTxIndex (Matt Corallo)
2862aca Move some additional variables into CChainState private (Matt Corallo)
fd4d80a Create initial CChainState to hold chain state information (Matt Corallo)
e104f0f Move block writing out of AcceptBlock (Matt Corallo)
50701ba Move txindex/undo data disk location stuff out of ConnectBlock (Matt Corallo)
93a34cf Make DisconnectBlock unaware of where undo data resides on disk (Matt Corallo)

Pull request description:

  CChainState should eventually, essentially, be our exposed "libconsensus", but we're probably a few releases away, so the real goal is to clarify our internal interfaces. The main split was a big step, but validation.cpp is still a somewhat ranomly-mixed bag of functions that are pure functions which validate inputs (which should probably either merge with their callers or move into another file in consensus/), read/write data from disk, manipulate our current chain state (which moves into CChainState), and do mempool transaction validation.

  Obviously this is only a small step, but some effort is made to clean up what functions the functions in CChainState call, and obviously as things are added its easy to keep clear "CChainState::* cannot call anything except via callbacks through CValidationInterface, pure functions, or disk read/write things". Right now there are some glaring violations in mempool callbacks, and general flushing logic needs cleaning up (FlushStateToDisk maybe shouldnt be called, and there should be an API towards setDirtyBlockIndex, but I'll leave that for after @sipa's current changesets land).

Tree-SHA512: 69b8ec191b36b19c9492b4dee74c8057621fb6ec98ad219e8da0b2ed5c3ad711b10b5af9ff1117e8807ccf88918eeeab573be8448baecc9a59f099c53095985b
2017-12-12 14:36:57 +01:00
..
bench Merge #11654: tests: Initialize recently introduced non-static class member lastCycles to zero in constructor 2017-11-16 11:49:42 +01:00
compat Merge #11140: Trivial: Improve #endif comments 2017-11-17 15:34:51 +01:00
config
consensus scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
crypto scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
leveldb
obj
obj-test
policy scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
primitives scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
qt Merge #11809: gui: Fix proxy setting options dialog crash 2017-12-07 17:40:11 +01:00
rpc qa: Add getrawtransaction in_active_chain=False test 2017-12-06 11:00:08 -05:00
script Merge #10699: Make all script validation flags backward compatible 2017-12-12 10:11:00 +01:00
secp256k1 Bump secp256k1 subtree 2017-09-29 16:02:39 +02:00
support scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
test Merge #10699: Make all script validation flags backward compatible 2017-12-12 10:11:00 +01:00
univalue Bump univalue and fix json formatting in tests 2017-09-29 14:35:46 +02:00
wallet don't attempt mempool entry for wallet transactions on startup if already in mempool 2017-12-11 09:08:54 -05:00
zmq Merge #10493: Use range-based for loops (C++11) when looping over map elements 2017-11-30 17:10:05 -05:00
.clang-format
addrdb.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
addrdb.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
addrman.cpp Merge #10493: Use range-based for loops (C++11) when looping over map elements 2017-11-30 17:10:05 -05:00
addrman.h Merge #10493: Use range-based for loops (C++11) when looping over map elements 2017-11-30 17:10:05 -05:00
amount.h
arith_uint256.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
arith_uint256.h Merge #10749: Use compile-time constants instead of unnamed enumerations (remove "enum hack") 2017-11-11 18:07:28 -05:00
base58.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
base58.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
bech32.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
bech32.h Import Bech32 C++ reference code & tests 2017-09-28 16:02:16 -07:00
bitcoin-cli-res.rc
bitcoin-cli.cpp cli: Reject arguments to -getinfo 2017-11-17 15:11:50 +01:00
bitcoin-tx-res.rc
bitcoin-tx.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
bitcoind-res.rc
bitcoind.cpp Create walletdir if datadir doesn't exist and fix tests 2017-11-18 00:50:59 +13:00
blockencodings.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
blockencodings.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
bloom.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
bloom.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
chain.cpp Merge #11337: Fix code constness in CBlockIndex::GetAncestor() overloads 2017-12-01 15:19:07 +01:00
chain.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
chainparams.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
chainparams.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
chainparamsbase.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
chainparamsbase.h
chainparamsseeds.h
checkpoints.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
checkpoints.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
checkqueue.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
clientversion.cpp refactor: Include obj/build.h instead of build.h 2017-11-16 08:23:03 +13:00
clientversion.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
coins.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
coins.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
compat.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
compressor.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
compressor.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
core_io.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
core_memusage.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
core_read.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
core_write.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
cuckoocache.h
dbwrapper.cpp Prefix leveldb debug logging 2017-11-30 09:29:25 +01:00
dbwrapper.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
fs.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
fs.h
hash.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
hash.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
httprpc.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
httprpc.h
httpserver.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
httpserver.h
indirectmap.h
init.cpp Merge #11831: Always return true if AppInitMain got to the end 2017-12-12 10:27:53 +01:00
init.h
key.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
key.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
keystore.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
keystore.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
limitedmap.h
Makefile.am Add -walletdir parameter to specify custom wallet dir 2017-11-18 00:50:58 +13:00
Makefile.bench.include build: Make "make clean" remove all files created when running "make check" 2017-10-04 14:54:41 +02:00
Makefile.leveldb.include
Makefile.qt.include Merge #11621: [build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck 2017-11-17 14:04:02 +01:00
Makefile.qttest.include
Makefile.test.include [tests] Test that mempool rejects coinbase transactions 2017-11-18 00:48:34 -08:00
memusage.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
merkleblock.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
merkleblock.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
miner.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
miner.h Make boost::multi_index comparators const 2017-12-07 10:06:38 -05:00
net_processing.cpp Merge #11583: Do not make it trivial for inbound peers to generate log entries 2017-12-11 17:06:22 +01:00
net_processing.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
net.cpp Merge #11583: Do not make it trivial for inbound peers to generate log entries 2017-12-11 17:06:22 +01:00
net.h Add Clang thread safety analysis annotations 2017-11-23 07:59:58 +01:00
netaddress.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
netaddress.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
netbase.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
netbase.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
netmessagemaker.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
noui.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
noui.h
pow.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
pow.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
prevector.h
protocol.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
protocol.h Add NODE_NETWORK_LIMITED flags and min block amount constants 2017-12-05 11:03:59 -10:00
pubkey.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
pubkey.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
random.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
random.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
rest.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
reverse_iterator.h
reverselock.h
scheduler.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
scheduler.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
serialize.h Merge #10493: Use range-based for loops (C++11) when looping over map elements 2017-11-30 17:10:05 -05:00
streams.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
sync.cpp threads: add a thread_local autoconf check 2017-11-27 15:01:47 -08:00
sync.h Switched sync.{cpp,h} to std threading primitives. 2017-11-18 11:35:14 -08:00
threadinterrupt.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
threadinterrupt.h
threadsafety.h
timedata.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
timedata.h
tinyformat.h [Util] Update tinyformat.h 2017-10-29 21:12:12 +08:00
torcontrol.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
torcontrol.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
txdb.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
txdb.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
txmempool.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
txmempool.h Make boost::multi_index comparators const 2017-12-07 10:06:38 -05:00
ui_interface.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
ui_interface.h
uint256.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
uint256.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
undo.h Remove trailing whitespace causing travis failure 2017-11-16 08:23:03 +13:00
util.cpp Test datadir in conf file exists 2017-12-06 00:24:06 +13:00
util.h Merge #11583: Do not make it trivial for inbound peers to generate log entries 2017-12-11 17:06:22 +01:00
utilmoneystr.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
utilmoneystr.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
utilstrencodings.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
utilstrencodings.h Implement BIP173 addresses and tests 2017-09-28 16:24:30 -07:00
utiltime.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
utiltime.h
validation.cpp Merge #10279: Add a CChainState class to validation.cpp to take another step towards clarifying internal interfaces 2017-12-12 14:36:57 +01:00
validation.h Merge #10279: Add a CChainState class to validation.cpp to take another step towards clarifying internal interfaces 2017-12-12 14:36:57 +01:00
validationinterface.cpp Fix shutdown in case of errors during initialization 2017-11-28 12:12:05 +01:00
validationinterface.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
version.h
versionbits.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
versionbits.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
warnings.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
warnings.h