aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2014-12-02Make comments in main an init doxygen compatibleMichael Ford
Fix typos where appropriate Update license/copyright
2014-11-28Merge pull request #5316Wladimir J. van der Laan
f86a24b Move `setmocktime` to hidden category (Wladimir J. van der Laan) bd9aebf Introduce a hidden category (Pieter Wuille) 0dd06b2 Delay writing block indexes in invalidate/reconsider (Pieter Wuille) 9b0a8d3 Add 'invalidateblock' and 'reconsiderblock' RPC commands. (Pieter Wuille)
2014-11-27Remove -printblock, -printblocktree, and -printblockindexPieter Wuille
2014-11-26Delay writing block indexes in invalidate/reconsiderPieter Wuille
2014-11-26Add 'invalidateblock' and 'reconsiderblock' RPC commands.Pieter Wuille
These can be used for testing reorganizations or for manual intervention in case of chain forks.
2014-11-26Merge pull request #5158Wladimir J. van der Laan
9ec75c5 Add a locking mechanism to IsInitialBlockDownload to ensure it never goes from false to true. (Ruben Dario Ponticelli) a2d0fc6 Fix IsInitialBlockDownload which was broken by headers first. (Ruben Dario Ponticelli)
2014-11-26Merge pull request #5321Wladimir J. van der Laan
34559c7 Make PruneBlockIndexCandidates safer (Pieter Wuille) cca48f6 Reset setBlockIndexCandidates once block index db loaded (21E14)
2014-11-25Merge pull request #5241Wladimir J. van der Laan
a206950 Introduce separate flushing modes (Pieter Wuille) 51ce901 Improve chainstate/blockindex disk writing policy (Pieter Wuille)
2014-11-24Merge pull request #5154Wladimir J. van der Laan
730b1ed Check pindexBestForkBase for null (21E14)
2014-11-24Introduce separate flushing modesPieter Wuille
2014-11-24Improve chainstate/blockindex disk writing policyPieter Wuille
There are 3 pieces of data that are maintained on disk. The actual block and undo data, the block index (which can refer to positions on disk), and the chainstate (which refers to the best block hash). Earlier, there was no guarantee that blocks were written to disk before block index entries referring to them were written. This commit introduces dirty flags for block index data, and delays writing entries until the actual block data is flushed. With this stricter ordering in writes, it is now safe to not always flush after every block, so there is no need for the IsInitialBlockDownload() check there - instead we just write whenever enough time has passed or the cache size grows too large. Also updating the wallet's best known block is delayed until this is done, otherwise the wallet may end up referring to an unknown block. In addition, only do a write inside the block processing loop if necessary (because of cache size exceeded). Otherwise, move the writing to a point after processing is done, after relaying.
2014-11-24Merge pull request #1816Wladimir J. van der Laan
b867e40 CreateNewBlock: Stick height in coinbase so we pass template sanity check (Luke Dashjr) 60755db submitblock: Check for duplicate submissions explicitly (Luke Dashjr) bc6cb41 QA RPC tests: Add tests block block proposals (Luke Dashjr) 9765a50 Implement BIP 23 Block Proposal (Luke Dashjr) 3dcbb9b Abstract DecodeHexBlk and BIP22ValidationResult functions out of submitblock (Luke Dashjr) 132ea9b miner_tests: Disable checkpoints so they don't fail the subsidy-change test (Luke Dashjr) df08a62 TestBlockValidity function for CBlock proposals (used by CreateNewBlock) (Luke Dashjr) 4ea1be7 CreateNewBlock and miner_tests: Also check generated template is valid by CheckBlockHeader, ContextualCheckBlockHeader, CheckBlock, and ContextualCheckBlock (Luke Dashjr) a48f2d6 Abstract context-dependent block checking from acceptance (Luke Dashjr)
2014-11-23Prioritize and display -testsafemode status in UIdexX7
Like in a real world situation, a safe mode test should also be visible in the UI. A test of safe mode is furthermore mostly relevant for developers, so it should not be overwritten by a warning about a pre-release test build.
2014-11-22Check pindexBestForkBase for null21E14
2014-11-21Merge pull request #5170Wladimir J. van der Laan
092b58d CBlockIndex::GetBlockWork() + GetProofIncrement(nBits) -> GetBlockProof(CBlockIndex) (jtimon) 22c4272 MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include main.h -> chain.h) (jtimon)
2014-11-20Make PruneBlockIndexCandidates saferPieter Wuille
2014-11-20Check block header before accepting it.Daniel Kraft
Previously, AcceptBlockHeader did not check the header (in particular PoW). This made the client accept invalid-PoW-headers from peers in headers-first sync.
2014-11-18TestBlockValidity function for CBlock proposals (used by CreateNewBlock)Luke Dashjr
2014-11-18Abstract context-dependent block checking from acceptanceLuke Dashjr
2014-11-12Merge pull request #5161Wladimir J. van der Laan
845c86d Do not use third party services for IP detection. (Gregory Maxwell)
2014-11-12Reset setBlockIndexCandidates once block index db loaded21E14
2014-11-07Do not use third party services for IP detection.Gregory Maxwell
This is a simplified re-do of closed pull #3088. This patch eliminates the privacy and reliability problematic use of centralized web services for discovering the node's addresses for advertisement. The Bitcoin protocol already allows your peers to tell you what IP they think you have, but this data isn't trustworthy since they could lie. So the challenge is using it without creating a DOS vector. To accomplish this we adopt an approach similar to the one used by P2Pool: If we're announcing and don't have a better address discovered (e.g. via UPNP) or configured we just announce to each peer the address that peer told us. Since peers could already replace, forge, or drop our address messages this cannot create a new vulnerability... but if even one of our peers is giving us a good address we'll eventually make a useful advertisement. We also may randomly use the peer-provided address for the daily rebroadcast even if we otherwise have a seemingly routable address, just in case we've been misconfigured (e.g. by UPNP). To avoid privacy problems, we only do these things if discovery is enabled.
2014-11-07Add a locking mechanism to IsInitialBlockDownload to ensure it never goes ↵Ruben Dario Ponticelli
from false to true.
2014-11-05Merge pull request #5173Wladimir J. van der Laan
50b43fd Be a bit more verbose during -loadblock if we already have blocks (Matt Corallo) 8375e22 Fix -loadblock after shutdown during IBD (Matt Corallo) 4ead850 Fix for crash during block download (Matt Corallo)
2014-11-03Merge pull request #5157Wladimir J. van der Laan
b4ee0bd Introduce preferred download peers (Pieter Wuille)
2014-11-03Merge pull request #5106Wladimir J. van der Laan
1bea2bb Rename ProcessBlock to ProcessNewBlock to indicate change of behaviour, and document it (Luke Dashjr) d29a291 Rename RPC_TRANSACTION_* errors to RPC_VERIFY_* and use RPC_VERIFY_ERROR for submitblock (Luke Dashjr) f877aaa Bugfix: submitblock: Use a temporary CValidationState to determine accurately the outcome of ProcessBlock, now that it no longer does the full block validity check (Luke Dashjr) 24e8896 Add CValidationInterface::BlockChecked notification (Luke Dashjr)
2014-10-29Be a bit more verbose during -loadblock if we already have blocksMatt Corallo
2014-10-29Fix -loadblock after shutdown during IBDMatt Corallo
2014-10-29Fix for crash during block downloadMatt Corallo
2014-10-29CBlockIndex::GetBlockWork() + GetProofIncrement(nBits) -> ↵jtimon
GetBlockProof(CBlockIndex)
2014-10-29Introduce preferred download peersPieter Wuille
2014-10-28Fix IsInitialBlockDownload which was broken by headers first.Ruben Dario Ponticelli
2014-10-28Rename ProcessBlock to ProcessNewBlock to indicate change of behaviour, and ↵Luke Dashjr
document it
2014-10-25Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille
Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete).
2014-10-22Merge pull request #4988Wladimir J. van der Laan
7b2bb96 Replace some function names with __func__ (Pieter Wuille) ed6d1a2 Keep information about all block files in memory (Pieter Wuille)
2014-10-22Merge pull request #5108Wladimir J. van der Laan
a873823 CAutoFile: Explicit Get() and remove unused methods (Wladimir J. van der Laan) fef24ca Add IsNull() to class CAutoFile and remove operator ! (Ruben Dario Ponticeli)
2014-10-22CAutoFile: Explicit Get() and remove unused methodsWladimir J. van der Laan
Also add documentation to some methods.
2014-10-21Replace some function names with __func__Pieter Wuille
2014-10-21Add CValidationInterface::BlockChecked notificationLuke Dashjr
2014-10-20Rename CWalletInterface to CValidationInterfacePieter Wuille
It's useful for much more than wallets.
2014-10-20Add IsNull() to class CAutoFile and remove operator !Ruben Dario Ponticeli
2014-10-14Fix large reorgsPieter Wuille
2014-10-14Fix rebuild-chainstate feature and improve its performancePieter Wuille
Previous refactorings broke the ability to rebuild the chainstate by deleting the chainstate directory, resulting in an incorrect "Incorrect or no genesis block found" error message. Fix that. Also, improve the performance of ActivateBestBlockStep by using the skiplist to only discover a few potential blocks to connect at a time, instead of all blocks forever - as we likely bail out after connecting a single one anyway.
2014-10-14Skip reindexed blocks individuallyPieter Wuille
Instead of skipping to the last reindexed block in each file (which could jump over processed out-of-order blocks), just skip each already processed block individually.
2014-10-14Make -reindex cope with out-of-order blocksWladimir J. van der Laan
Remember out-of-order block headers along with disk positions. This is likely the simplest and least-impact way to make -reindex work with headers first. Based on top of #4468.
2014-10-14Rename setBlockIndexValid to setBlockIndexCandidatesPieter Wuille
2014-10-14Add height to "Requesting block" debugR E Broadley
2014-10-14Better logging of stallingR E Broadley
2014-10-14Improve getheaders (sending) loggingR E Broadley
2014-10-14Remove CheckMinWork, as we always know all parent headersPieter Wuille