aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
AgeCommit message (Collapse)Author
2019-02-24Call InvalidateBlock without cs_main heldPieter Wuille
2019-02-12[rpc] mining: Omit uninitialized currentblockweight, currentblocktxMarcoFalke
2019-02-01doc: Add cs_main lock annotations for mapBlockIndexpracticalswift
2019-01-30Merge #15163: Correct units for "-dbcache" and "-prune"Wladimir J. van der Laan
6f6514a08090b37b5e8c086015ee4881813ef867 Correct units for "-dbcache" and "-prune" (Hennadii Stepanov) Pull request description: Actually, all `dbcache`-related values in the code are measured in MiB (not in megabytes, MB) or in bytes (e.g., `nTotalCache`). See: https://github.com/bitcoin/bitcoin/blob/master/src/txdb.h https://github.com/bitcoin/bitcoin/blob/ba8c8b22272ad40fe2de465d7e745532bab48d3b/src/init.cpp#L1405-L1424 Also, "-prune" is fixed: 1. The GUI values in GB are translated to the node values in MiB correctly. 2. The maximum of the "prune" `QSpinBox` is not limited by default value of 99 (GB). Fix: #15106 Tree-SHA512: 151ec43b31b1074db8b345fedb1dcc10bde225899a5296bfc183f57e1553d13ac27db8db100226646769ad03c9fcab29d88763065a471757c6c41ac51108459d
2019-01-30Merge #15159: [RPC] Remove lookup to UTXO set from GetTransactionMarcoFalke
04da9f4834 [RPC] Update getrawtransaction interface (Amiti Uttarwar) Pull request description: - stop checking unspent UTXOs for a transaction when txindex is not enabled, as per conversation here: https://github.com/bitcoin/bitcoin/issues/3220#issuecomment-377458383 - code contributed by sipa Tree-SHA512: aa07353bccc14b81b7803992a25d076d6bc06d15ec7c1b85828dc10aea7e0498d9b49f71783e352ab8a14b0bb2010cfb7835de3dfd1bc6f2323f460449348e66
2019-01-30Correct units for "-dbcache" and "-prune"Hennadii Stepanov
All dbcache-related values in the code are measured in MiB (not in megabytes, MB) or in bytes. The GUI "-prune" values in GB are translated to the node values in MiB correctly. The maximum of the "-prune" QSpinBox is not limited by the default value of 99 (GB). Also, this improves log readability.
2019-01-26[RPC] Update getrawtransaction interfaceAmiti Uttarwar
2019-01-22Default -whitelistforcerelay to offSuhas Daftuar
2018-11-30Merge #13258: uint256: Remove unnecessary crypto/common.h dependencyWladimir J. van der Laan
bf2e01097 uint256: Remove unnecessary crypto/common.h use (Karl-Johan Alm) Pull request description: This is an alternative to #13242 which keeps the `ReadLE64` part, but moves the `crypto/common.h` dependency into `crypto/common.h` as a function outside of `uint256`. **Reason:** this change will remove dependencies for `uint256` to `crypto/common.h`, `compat/endian.h`, and `compat/byteswap.h`. This PR removes the need to update tests to be endian-aware/-independent, but keeps the (arguably dubious) `ReadLE64` part (which was only introduced to fix the tests, not for any functionality). Tree-SHA512: 78b35123cdb185b3b3ec59aba5ca8a5db72624d147f2d6a5484ffa5ce626a72f782a01dc6893fc8f5619b03e2eae7b5a03b0df5d43460f3bda428e719e188aec
2018-10-27Merge #13783: validation: Pass tx pool reference into CheckSequenceLocksMarcoFalke
fa511e8dad Pass tx pool reference into CheckSequenceLocks (MarcoFalke) Pull request description: `CheckSequenceLocks` is called from ATMP and the member function `CTxMemPool::removeForReorg` without passing in the tx pool object that is used in those function's scope and instead using the global `::mempool` instance. This fix should be refactoring only, since currently there is only one (global) tx pool in normal operation. Though, it fixes hard to track down issues in future settings where more than one mempool exists at a time. (E.g. for tests, rpc or p2p tx relay purposes) Tree-SHA512: f0804588c7d29bb6ff05ec14f22a16422b89ab31ae714f38cd07f811d7dc7907bfd14e799c4c1c3121144ff22711019bbe9212b39e2fd4531936a4119950fa49
2018-10-10Add compile time checking for cs_main locks which we assert at run timepracticalswift
2018-09-18uint256: Remove unnecessary crypto/common.h useKarl-Johan Alm
2018-09-15use integer division instead of double conversion and multiplication for ↵Arvid Norberg
computing amounts
2018-09-11Pass tx pool reference into CheckSequenceLocksMarcoFalke
2018-08-31scripted-diff: Small locking renameRussell Yanofsky
Call sync.h primitives "locks" and "mutexes" instead of "blocks" and "waitable critical sections" to match current coding conventions and c++11 standard names. This PR does not rename the "CCriticalSection" class (though this could be done as a followup) because it is used everywhere and would swamp the other changes in this PR. Plain mutexes should mostly be preferred instead of recursive mutexes in new code anyway. -BEGIN VERIFY SCRIPT- set -x set -e ren() { git grep -l $1 | xargs sed -i s/$1/$2/; } ren CCriticalBlock UniqueLock ren CWaitableCriticalSection Mutex ren CConditionVariable std::condition_variable ren cs_GenesisWait g_genesis_wait_mutex ren condvar_GenesisWait g_genesis_wait_cv perl -0777 -pi -e 's/.*typedef.*condition_variable.*\n\n?//g' src/sync.h -END VERIFY SCRIPT-
2018-08-26Add compile time checking for all cs_main runtime locking assertionspracticalswift
2018-08-08Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan
3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-07-27Return void instead of bool for functions that cannot failpracticalswift
* CBlockTreeDB::ReadReindexing(...) * CChainState::ResetBlockFailureFlags(...) * CTxMemPool::addUnchecked(...) * CWallet::LoadDestData(...) * CWallet::LoadKeyMetadata(...) * CWallet::LoadScriptMetadata(...) * CWallet::LoadToWallet(...) * CWallet::SetHDChain(...) * CWallet::SetHDSeed(...) * RemoveLocal(...) * SetMinVersion(...) * StartHTTPServer(...) * StartRPC(...) * TorControlConnection::Disconnect(...)
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-24scripted-diff: Remove trailing whitespacesJoão Barbosa
-BEGIN VERIFY SCRIPT- sed --in-place'' --regexp-extended 's/[[:space:]]+$//g' $(git grep -I --files-with-matches --extended-regexp '[[:space:]]+$' -- src test ':!*.svg' ':!src/crypto/sha256_sse4*' ':!src/leveldb' ':!src/qt/locale' ':!src/secp256k1' ':!src/univalue') -END VERIFY SCRIPT-
2018-07-16Merge #13298: Net: Bucketing INV delays (1 bucket) for incoming connections ↵Pieter Wuille
to hide tx time d45b344ffd Bucket for inbound when scheduling invs to hide tx time (Gleb) Pull request description: It has been brought up to my attention that current random delays mechanism (originally intended to obfuscate transaction metadata) allows to easily estimate the time a transaction was received by a node. It may be done by connecting multiple observer nodes to the same node. Each of those nodes will generate its own schedule of delays. Combined metadata regarding those events from different sources allows an observer to estimate transaction time. After this patch a spy won't gain additional information by just creating multiple connections to a target. Tree-SHA512: c71dae5ff350b614cb40a8e201fd0562d3e03e3e72a5099718cd451f0d84c66d5e52bbaf0d5b4b75137514c8efdedcc6ef4df90142b360153f04ad0721545ab1
2018-07-13Bucket for inbound when scheduling invs to hide tx timeGleb
2018-06-18doc: Rewrite some validation doc as lock annotationsMarcoFalke
2018-06-15Merge #13402: Document validationinterace callback blocking deadlock potential.MarcoFalke
25bc9615b7 Document validationinterace callback blocking deadlock potential. (Matt Corallo) Pull request description: From the branches-I've-had-lying-around-and-forgot-to-PR department... This is a comment-only PR, but the comments point out an API quirk that isn't exactly trivial. None of our use-cases right now hit this, but if we were to call SyncWithValidationInterfaceQueue (eg to limit queue depth) in ATMP, I'm pretty sure we'd hit a deadlock there. Tree-SHA512: 889dd8fc9eb15d1f2aa5ca467e783bc8f07bc543b166b032741795b0db7a0df11a2846d3cb7c69bafa8d1acf970021001b742f52be06725a932813230c5b4a7b
2018-06-05Document validationinterace callback blocking deadlock potential.Matt Corallo
2018-05-30refactor: add a function for determining if a block is pruned or notKarl-Johan Alm
2018-05-15net: Serve blocks directly from disk when possibleWladimir J. van der Laan
In `ProcessGetBlockData`, send the block data directly from disk if type MSG_WITNESS_BLOCK is requested. This is a valid shortcut as the on-disk format matches the network format. This is expected to increase performance because a deserialization and subsequent serialization roundtrip is avoided.
2018-04-25[validation] Replace tx index code in validation code with TxIndex.Jim Posen
2018-04-13Separate NULLDUMMY enforcement from SEGWIT enforcementSuhas Daftuar
This is in preparation for enforcing SCRIPT_VERIFY_WITNESS from the genesis block.
2018-04-12Merge #12743: Fix csBestBlock/cvBlockChange waiting in rpc/miningPieter Wuille
4a6c0e3dcf Modernize best block mutex/cv/hash variable naming (Pieter Wuille) 45dd135039 Fix csBestBlock/cvBlockChange waiting in rpc/mining (Pieter Wuille) Pull request description: This is an alternative to #11694. It reintroduces a uint256 variable with the best block hash, protected by csBestBlock, and only updated while holding it. Also rename the involved variable to modern guidelines, as there are very few uses. Tree-SHA512: 826a86c7d3cee7fe49f99f4398ae99e81cb0563197eaeba77306a3ca6072b67cdb932bc35720fc0f99c2a57b218efa029d0b8bdfb240591a629b2e90efa3199d
2018-04-05Merge #12859: Bugfix: Include <memory> for std::unique_ptrWladimir J. van der Laan
a5bca13 Bugfix: Include <memory> for std::unique_ptr (Luke Dashjr) Pull request description: Not sure why all these includes were missing, but it's breaking builds for some users: https://bugs.gentoo.org/show_bug.cgi?id=652142 (Added to all files with a reference to `std::unique_ptr`) Tree-SHA512: 8a2c67513ca07b9bb52c34e8a20b15e56f8af2530310d9ee9b0a69694dd05e02e7a3683f14101a2685d457672b56addec591a0bb83900a0eb8e2a43d43200509
2018-04-03Modernize best block mutex/cv/hash variable namingPieter Wuille
2018-04-03Fix csBestBlock/cvBlockChange waiting in rpc/miningPieter Wuille
2018-04-02Bugfix: Include <memory> for std::unique_ptrLuke Dashjr
2018-04-02Merge #11742: rpc: Add testmempoolacceptWladimir J. van der Laan
b55555d rpc: Add testmempoolaccept (MarcoFalke) Pull request description: To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo. The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state. Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
2018-03-29Bugfix: RPC: savemempool: Don't save until LoadMempool() is finishedJorge Timón
2018-03-28Merge #12798: doc: Refer to witness reserved value as spec. in the BIPWladimir J. van der Laan
adc2586 doc: Refer to witness reserved value as spec. in the BIP (MarcoFalke) Pull request description: BIP141 refers to the coinbase's input's witness that consists of a single 32-byte array as "witness reserved value". This updates the code to follow the BIP Tree-SHA512: 49c9463519bd11b9ff322eeecd638f7627aa8efdfb869f8549f9a160ff34281e1b5a0b9d83545a692de6f5ff795055292c423403b0f3ce7597e3f32273cf1deb
2018-03-27Merge #12653: Allow to optional specify the directory for the blocks storageWladimir J. van der Laan
a192636 -blocksdir: keep blockindex leveldb database in datadir (Jonas Schnelli) f38e4fd QA: Add -blocksdir test (Jonas Schnelli) 386a6b6 Allow to optional specify the directory for the blocks storage (Jonas Schnelli) Pull request description: Since the actual block files taking up more and more space, it may be desirable to have them stored in a different location then the data directory (use case: SSD for chainstate, etc., HD for blocks). This PR adds a `-blocksdir` option that allows one to keep the blockfiles and the blockindex external from the data directory (instead of creating symlinks). I fist had an option to keep the blockindex within the datadir, but seems to make no sense since accessing the index will (always) lead to access (r/w) the block files. Tree-SHA512: f8b9e1a681679eac25076dc30e45e6e12d4b2d9ac4be907cbea928a75af081dbcb0f1dd3e97169ab975f73d0bd15824c00c2a34638f3b284b39017171fce2409
2018-03-26doc: Refer to witness reserved value as spec. in the BIPMarcoFalke
2018-03-24rpc: Add testmempoolacceptMarcoFalke
2018-03-11Allow to optional specify the directory for the blocks storageJonas Schnelli
2018-03-06Add LookupBlockIndex functionJoão Barbosa
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
2017-12-12Merge #10279: Add a CChainState class to validation.cpp to take another step ↵Wladimir J. van der Laan
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-09Merge #11740: Implement BIP159 NODE_NETWORK_LIMITED (pruned peers) ↵Wladimir J. van der Laan
*signaling only* de74c62 [Doc] Update bip.md, add support for BIP 159 (Jonas Schnelli) e054d0e [QA] Add node_network_limited test (Jonas Schnelli) bd09416 Avoid leaking the prune height through getdata (fingerprinting countermeasure) (Jonas Schnelli) 27df193 Always set NODE_NETWORK_LIMITED bit (Jonas Schnelli) 7caba38 Add NODE_NETWORK_LIMITED flags and min block amount constants (Jonas Schnelli) Pull request description: Extracted from #10387. Does implement BIP159, but only the signalling part. No connections are made to NODE_NETWORK_LIMITED in this PR. The address relay and connection work (the more complicated part) can then be separated (probably in #10387). Tree-SHA512: e3218eb4789a9320b0f42dc10f62d30c13c49bdef00443fbe653bee22933477adcfc1cf8f6a95269324560b5721203ed41f3c5e2dd8a98ec2791f6a9d8346b1a
2017-12-05Add NODE_NETWORK_LIMITED flags and min block amount constantsJonas Schnelli
2017-12-05[rpc] Allow getrawtransaction to take optional blockhash to fetch ↵Karl-Johan Alm
transaction from a block directly.
2017-12-04Move some additional variables into CChainState privateMatt Corallo
2017-12-04Create initial CChainState to hold chain state informationMatt Corallo
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-