lbrycrd/src
mrbandrews f9ec3f0fad Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:

- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
  reasonably be met, with some assumptions about block sizes, orphan rates,
  etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
  mainnet; defined separately for mainnet, testnet, and regtest in chainparams
  as nPruneAfterHeight).

This unsets NODE_NETWORK if pruning is enabled.

Also included is an RPC test for pruning (pruning.py).

Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-04-22 15:53:48 -04:00
..
compat build: Endian compatibility 2015-03-06 15:54:53 +01:00
config build: move bitcoin-config.h to its own directory 2014-06-21 19:47:43 +02:00
consensus ensure consistent header comment naming conventions 2015-04-20 13:29:22 +02:00
crypto build: Endian compatibility 2015-03-06 15:54:53 +01:00
json json_spirit: #include <stdint.h> 2014-05-13 11:41:59 +02:00
leveldb Merge src/leveldb changes for LevelDB 1.18. 2014-10-16 12:23:50 -07:00
obj
obj-test
primitives Merge pull request #5831 2015-03-16 12:23:14 +01:00
qt Merge pull request #5911 2015-04-20 16:37:38 +02:00
script Abstract out Ctransaction-specific signing into TransactionSignatureCreator 2015-03-21 07:06:18 -07:00
secp256k1 Update libsecp256k1. 2015-03-27 14:03:36 -07:00
support ensure consistent header comment naming conventions 2015-04-20 13:29:22 +02:00
test Revert mining changes in #5957 2015-04-10 07:51:27 +02:00
univalue Remove references to X11 licence 2014-12-16 15:56:50 +08:00
wallet trivial string change in wallet.cpp (the -> that) 2015-04-20 13:29:23 +02:00
.clang-format Update coding style and add .clang-format 2014-07-28 22:08:13 +02:00
addrman.cpp Cap nAttempts penalty at 8 and switch to pow instead of a division loop. 2015-04-19 11:47:56 -07:00
addrman.h Scale up addrman 2015-03-23 17:24:29 -07:00
alert.cpp Chainparams: Decouple CAlert from CChainParams 2015-04-04 12:58:14 +02:00
alert.h Chainparams: Decouple CAlert from CChainParams 2015-04-04 12:58:14 +02:00
amount.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
amount.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
arith_uint256.cpp src/arith_256.cpp: bigendian compatibility 2015-03-06 17:21:59 +01:00
arith_uint256.h ensure consistent header comment naming conventions 2015-04-20 13:29:22 +02:00
base58.cpp openssl: abstract out OPENSSL_cleanse 2015-02-15 11:34:02 -05:00
base58.h allocators: split allocators and pagelocker 2015-03-20 12:23:44 +01:00
bitcoin-cli-res.rc Remove references to X11 licence 2014-12-16 15:56:50 +08:00
bitcoin-cli.cpp Help messages correctly formatted (79 chars) 2015-03-10 22:07:17 -07:00
bitcoin-tx.cpp Help messages correctly formatted (79 chars) 2015-03-10 22:07:17 -07:00
bitcoind-res.rc Remove references to X11 licence 2014-12-16 15:56:50 +08:00
bitcoind.cpp Use https link to bitcoin.org in Doxygen intro 2015-04-20 13:29:21 +02:00
bloom.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
bloom.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
chain.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
chain.h Add more information to errors in ReadBlockFromDisk 2015-02-05 14:21:25 +01:00
chainparams.cpp Add block pruning functionality 2015-04-22 15:53:48 -04:00
chainparams.h Add block pruning functionality 2015-04-22 15:53:48 -04:00
chainparamsbase.cpp test: Remove UNITTEST params 2015-03-09 16:06:14 +01:00
chainparamsbase.h test: Remove UNITTEST params 2015-03-09 16:06:14 +01:00
chainparamsseeds.h Update seed IPs, based on bitcoin.sipa.be crawler data 2015-01-05 17:23:23 +01:00
checkpoints.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
checkpoints.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
checkqueue.h Merge pull request #5721 2015-02-06 16:51:39 +01:00
clientversion.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
clientversion.h Bump project-wide COPYRIGHT_YEAR to 2015 2015-01-02 10:53:13 +01:00
coincontrol.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
coins.cpp Merge pull request #5597 2015-01-07 13:03:41 +01:00
coins.h Replace direct use of 0 with SetNull and IsNull 2015-01-05 15:45:34 +01:00
compat.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
compressor.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
compressor.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
core_io.h Merge pull request #5499 2014-12-31 10:50:06 +01:00
core_read.cpp namespace: drop most boost namespaces and a few header cleanups 2015-01-02 15:12:03 -05:00
core_write.cpp Replace direct use of 0 with SetNull and IsNull 2015-01-05 15:45:34 +01:00
eccryptoverify.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
eccryptoverify.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
ecwrapper.cpp Improve robustness of DER recoding code 2015-01-12 08:59:03 +01:00
ecwrapper.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
hash.cpp src/hash.cpp: endian compatibility 2015-03-06 15:54:53 +01:00
hash.h Squashed 'src/secp256k1/' changes from 50cc6ab..1897b8e 2015-03-27 14:03:36 -07:00
init.cpp Add block pruning functionality 2015-04-22 15:53:48 -04:00
init.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
key.cpp Switch test case signing to RFC6979 extra entropy 2015-03-27 15:31:47 -07:00
key.h Switch test case signing to RFC6979 extra entropy 2015-03-27 15:31:47 -07:00
keystore.cpp wallet: move crypter to wallet 2015-03-22 15:18:55 -04:00
keystore.h c++11: don't forward-declare types used in maps 2015-02-03 23:30:59 -05:00
leveldbwrapper.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
leveldbwrapper.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
limitedmap.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
main.cpp Add block pruning functionality 2015-04-22 15:53:48 -04:00
main.h Add block pruning functionality 2015-04-22 15:53:48 -04:00
Makefile.am Consensus: Refactor: Introduce Consensus::Params class 2015-03-25 20:39:26 +01:00
Makefile.qt.include [Qt] optimize helpmessage dialog 2015-01-09 21:11:47 +01:00
Makefile.qttest.include build: make a distinction between static app ldflags and static lib ldflags 2014-11-19 22:08:27 -05:00
Makefile.test.include Keep mempool consistent during block-reorgs 2015-03-26 11:58:19 -04:00
merkleblock.cpp Replace direct use of 0 with SetNull and IsNull 2015-01-05 15:45:34 +01:00
merkleblock.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
miner.cpp Chainparams: Refactor: Remove redundant AllowMinDifficultyBlocks() getter 2015-04-15 14:31:44 +02:00
miner.h miner.h: fix clang warning because of class/struct mix 2015-04-16 10:32:47 +02:00
mruset.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
net.cpp Merge pull request #5941 2015-04-01 16:17:13 +02:00
net.h Merge pull request #5859 2015-03-12 11:14:03 +01:00
netbase.cpp privacy: Stream isolation for Tor 2015-04-17 13:26:47 +02:00
netbase.h privacy: Stream isolation for Tor 2015-04-17 13:26:47 +02:00
noui.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
noui.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
pow.cpp consensus: don't use arith_uint256 in consensus.h 2015-04-10 15:33:37 -04:00
pow.h Consensus: Refactor: Decouple pow.o from chainparams.o 2015-03-26 00:47:51 +01:00
protocol.cpp make CMessageHeader a dumb storage class 2015-02-25 18:44:49 -05:00
protocol.h Add a NODE_GETUTXO service bit and document NODE_NETWORK. 2015-03-21 19:35:02 +01:00
pubkey.cpp keys: remove libsecp256k1 verification until it's actually supported 2015-03-02 11:31:43 -05:00
pubkey.h Replace direct use of 0 with SetNull and IsNull 2015-01-05 15:45:34 +01:00
random.cpp WIN32 Seed Cleanup: Move nLastPerfmon behind win32 ifdef. 2015-02-25 18:37:06 -05:00
random.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
rest.cpp Merge #5548: [REST] add /rest/chaininfos 2015-02-10 12:08:07 +01:00
rpcblockchain.cpp Removed main.h dependency from rpcserver.cpp 2015-01-28 07:41:54 +01:00
rpcclient.cpp Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
rpcclient.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
rpcmining.cpp Chainparams: Refactor: Remove redundant AllowMinDifficultyBlocks() getter 2015-04-15 14:31:44 +02:00
rpcmisc.cpp privacy: Stream isolation for Tor 2015-04-17 13:26:47 +02:00
rpcnet.cpp privacy: Stream isolation for Tor 2015-04-17 13:26:47 +02:00
rpcprotocol.cpp namespace: drop most boost namespaces and a few header cleanups 2015-01-02 15:12:03 -05:00
rpcprotocol.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
rpcrawtransaction.cpp Fix docs for 'complete' field in 'signrawtransaction' response 2015-04-20 13:29:20 +02:00
rpcserver.cpp Push down RPC reqWallet flag 2015-04-12 19:37:29 +02:00
rpcserver.h Push down RPC reqWallet flag 2015-04-12 19:37:29 +02:00
serialize.h src/serialize.h: base serialization level endianness neutrality 2015-03-06 17:21:58 +01:00
streams.h allocators: split allocators and pagelocker 2015-03-20 12:23:44 +01:00
sync.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
sync.h [Trivial] format sync.h 2015-04-20 13:29:21 +02:00
threadsafety.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
timedata.cpp Merge pull request #5476 2015-01-02 17:54:21 +01:00
timedata.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
tinyformat.h Move *Version() functions to version.h/cpp 2014-08-26 13:25:21 +02:00
txdb.cpp Consensus: Refactor: Decouple pow.o from chainparams.o 2015-03-26 00:47:51 +01:00
txdb.h Fix clang compile warnings intriduced in #5681 2015-03-29 19:45:05 +08:00
txmempool.cpp Keep mempool consistent during block-reorgs 2015-03-26 11:58:19 -04:00
txmempool.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
ui_interface.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
uint256.cpp BUGFIX: Stack around the variable 'rv' was corrupted 2015-03-12 22:17:22 +06:00
uint256.h uint256->arith_uint256 blob256->uint256 2015-01-05 15:45:35 +01:00
undo.h MOVEONLY: CBlockUndo from main.h to undo.h 2014-12-27 16:01:31 +01:00
util.cpp Initialization: set fallback locale as environment variable 2015-03-27 01:57:00 +01:00
util.h Squashed 'src/secp256k1/' changes from 50cc6ab..1897b8e 2015-03-27 14:03:36 -07:00
utilmoneystr.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
utilmoneystr.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
utilstrencodings.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
utilstrencodings.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
utiltime.cpp Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
utiltime.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00
validationinterface.cpp Regression test for ResendWalletTransactions 2015-03-24 15:29:20 -04:00
validationinterface.h Merge pull request #5940 2015-03-30 14:28:09 +02:00
version.h Added "Core" to copyright headers 2014-12-19 19:55:32 +01:00