aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
AgeCommit message (Collapse)Author
2014-09-04Use boost::unordered_map for mapBlockIndexPieter Wuille
2014-09-04Introduce BlockMap type for mapBlockIndexPieter Wuille
2014-09-03Merge pull request #4808Pieter Wuille
3f6540a Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODS (Pieter Wuille) 47eb765 Serializer simplifications after IMPLEMENT_SERIALIZE overhaul (Pieter Wuille)
2014-09-02Use OR of respective block flags for masksPieter Wuille
2014-09-02Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODSPieter Wuille
2014-09-01Serializer simplifications after IMPLEMENT_SERIALIZE overhaulPieter Wuille
2014-09-01Merge pull request #4737Pieter Wuille
31e9a83 Use CSizeComputer to avoid counting sizes in SerializationOp (Pieter Wuille) 84881f8 rework overhauled serialization methods to non-static (Kamil Domanski) 5d96b4a remove fields of ser_streamplaceholder (Kamil Domanski) 3d796f8 overhaul serialization code (Kamil Domanski)
2014-09-01Merge pull request #4779Wladimir J. van der Laan
093303a add missing header end comments (Philip Kaufmann)
2014-09-01Merge pull request #4768Wladimir J. van der Laan
2e28031 Perform CVerifyDB on pcoinsdbview instead of pcoinsTip (Wladimir J. van der Laan)
2014-08-31Use CSizeComputer to avoid counting sizes in SerializationOpPieter Wuille
2014-08-31rework overhauled serialization methods to non-staticKamil Domanski
Thanks to Pieter Wuille for most of the work on this commit. I did not fixup the overhaul commit, because a rebase conflicted with "remove fields of ser_streamplaceholder". I prefer not to risk making a mistake while resolving it.
2014-08-31overhaul serialization codeKamil Domanski
The implementation of each class' serialization/deserialization is no longer passed within a macro. The implementation now lies within a template of form: template <typename T, typename Stream, typename Operation> inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; /* CODE */ return nSerSize; } In cases when codepath should depend on whether or not we are just deserializing (old fGetSize, fWrite, fRead flags) an additional clause can be used: bool fRead = boost::is_same<Operation, CSerActionUnserialize>(); The IMPLEMENT_SERIALIZE macro will now be a freestanding clause added within class' body (similiar to Qt's Q_OBJECT) to implement GetSerializeSize, Serialize and Unserialize. These are now wrappers around the "SerializationOp" template.
2014-08-29Move CMerkleTx to wallet.cpp/hWladimir J. van der Laan
It is only used by the wallet so it has no place in main.
2014-08-28add missing header end commentsPhilip Kaufmann
- ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files
2014-08-28Fix a few "Uninitialized scalar field" warningsWladimir J. van der Laan
Fix a few warnings reported by Coverity. None of these is critical, but making sure that class fields are initialized can avoid heisenbugs.
2014-08-27Merge pull request #4377Pieter Wuille
654871d replace ComputeMinWork with CheckMinWork (jtimon) b343c1a Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits) (jtimon) c2c02f3 Move UpdateTime to pow (jtimon)
2014-08-27Merge pull request #4764Pieter Wuille
92bb6f2 Bypass reloading blocks from disk (Pieter Wuille)
2014-08-27Perform CVerifyDB on pcoinsdbview instead of pcoinsTipWladimir J. van der Laan
Bypassing the main coins cache allows more thorough checking with the same memory budget. This has no effect on performance because everything ends up in the child cache created by VerifyDB itself. It has bugged me ever since #4675, which effectively reduced the number of checked blocks to reduce peak memory usage. - Pass the coinsview to use as argument to VerifyDB - This also avoids that the first `pcoinsTip->Flush()` after VerifyDB writes a large slew of unchanged coin records back to the database.
2014-08-26Merge pull request #4748Pieter Wuille
ad49c25 Split up util.cpp/h (Wladimir J. van der Laan) f841aa2 Move `COIN` and `CENT` to core.h (Wladimir J. van der Laan) 6e5fd00 Move `*Version()` functions to version.h/cpp (Wladimir J. van der Laan) b4aa769 Move `S_I*` constants and `MSG_NOSIGNAL` to compat.h (Wladimir J. van der Laan) af8297c Move functions in wallet.h to implementation file (Wladimir J. van der Laan) 651480c move functions in main and net to implementation files (Wladimir J. van der Laan) 610a8c0 Move SetThreadPriority implementation to util.cpp instead of the header (Wladimir J. van der Laan) f780e65 Remove unused function `ByteReverse` from util.h (Wladimir J. van der Laan) 121d6ad Remove unused `alignup` function from util.h (Wladimir J. van der Laan) d1e26d4 Move CMedianFilter to timedata.cpp (Wladimir J. van der Laan)
2014-08-26move functions in main and net to implementation filesWladimir J. van der Laan
2014-08-26Use const CCoinsView's at some places.Daniel Kraft
At some places where it is possible (e. g., CheckInputs), use a const version of CCoinsView instead of a non-const one.
2014-08-26Bypass reloading blocks from diskPieter Wuille
2014-08-23Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits)jtimon
2014-08-23Move UpdateTime to powjtimon
2014-08-20Remove all other print() methodsWladimir J. van der Laan
All unused.
2014-08-13Reapply: Reject transactions with excessive numbers of sigopsPeter Todd
Reverting was based on a misunderstanding, it appears. Github-Pull: #4150
2014-08-12Revert "Reject transactions with excessive numbers of sigops"Wladimir J. van der Laan
This reverts commit 4fad8e6d831729efa1965fa2034e7e51d3d0a1be.
2014-08-12Merge pull request #4150Wladimir J. van der Laan
4fad8e6 Reject transactions with excessive numbers of sigops (Peter Todd)
2014-08-03Implement "getchaintips" RPC command to monitor blockchain forks.Daniel Kraft
Port over https://github.com/chronokings/huntercoin/pull/19 from Huntercoin: This implements a new RPC command "getchaintips" that can be used to find all currently active chain heads. This is similar to the -printblocktree startup option, but it can be used without restarting just via the RPC interface on a running daemon.
2014-07-27Rework block processing benchmark codePieter Wuille
* Replace -benchmark (and the related fBenchmark) with a regular debug option, -debug=bench. * Increase coverage and granularity of individual block processing steps. * Add cummulative times.
2014-07-21Revert "Relay double-spends, subject to anti-DOS"Wladimir J. van der Laan
This reverts commit d640a3ceab4f4372c2a0f738c1286cfde4b41b50.
2014-07-21Revert "Remove signal DoubleSpendDetected, use function"Wladimir J. van der Laan
This reverts commit 0da6b3fd187da3aa810aaa584d8bd197ad4fa2b9.
2014-07-18Introduce option to disable relay/mining of bare multisig scripts in TX outputsJeff Garzik
First and foremost, this defaults to OFF. This option lets a node consider such transactions non-standard, meaning they will not be relayed or mined by default, but other miners are free to mine these as usual.
2014-07-13Reject transactions with excessive numbers of sigopsPeter Todd
2014-07-11getblocktemplate: longpolling supportLuke Dashjr
2014-07-07Merge pull request #4457Wladimir J. van der Laan
834e46e CBlockIndex()::SetNull() method to avoid code repetition (jtimon)
2014-07-04Merge pull request #4450Wladimir J. van der Laan
0da6b3f Remove signal DoubleSpendDetected, use function (Tom Harding) 88dd359 Check signatures before respend relay (Tom Harding)
2014-07-03Move fee policy out of coreGavin Andresen
2014-07-03Sanity checks for estimatesGavin Andresen
Require at least 11 samples before giving fee/priority estimates. And have wallet-created transactions go throught the fee-sanity-check code path.
2014-07-03Use fee/priority estimates in wallet CreateTransactionGavin Andresen
The wallet now uses the mempool fee estimator with a new command-line option: -txconfirmtarget (default: 1) instead of using hard-coded fees or priorities. A new bitcoind that hasn't seen enough transactions to estimate will fall back to the old hard-coded minimum priority or transaction fee. -paytxfee option overrides -txconfirmtarget. Relaying and mining code isn't changed. For Qt, the coin control dialog now uses priority estimates to label transaction priority (instead of hard-coded constants); unspent outputs were consistently labeled with a much higher priority than is justified by the free transactions actually being accepted into blocks. I did not implement any GUI for setting -txconfirmtarget; I would suggest getting rid of the "Pay transaction fee" GUI and replace it with either "target number of confirmations" or maybe a "faster confirmation <--> lower fee" slider or select box.
2014-07-02CBlockIndex()::SetNull() method to avoid code repetitionjtimon
2014-07-02Remove signal DoubleSpendDetected, use functionTom Harding
Also removes the need for forward reference to RelayableRespend.
2014-06-30Merge pull request #3883 from dgenr8/first_double_spendGavin Andresen
Relay and alert user to double spends
2014-06-29Add a skiplist to the CBlockIndex structure.Pieter Wuille
This allows fast (O(log n)) access to far predecessor blocks. Use it to speed up CChain::FindFork and CChain::GetLocator.
2014-06-29Track peers' available blocksPieter Wuille
2014-06-27Relay double-spends, subject to anti-DOSTom Harding
Allows network wallets and other clients to see transactions that respend a prevout already spent in an unconfirmed transaction in this node's mempool. Knowledge of an attempted double-spend is of interest to recipients of the first spend. In some cases, it will allow these recipients to withhold goods or services upon being alerted of a double-spend that deprives them of payment. As before, respends are not added to the mempool. Anti-Denial-of-Service-Attack provisions: - Use a bloom filter to relay only one respend per mempool prevout - Rate-limit respend relays to a default of 100 thousand bytes/minute - Define tx2.IsEquivalentTo(tx1): equality when scriptSigs are not considered - Do not relay these equivalent transactions Remove an unused variable declaration in txmempool.cpp.
2014-06-27Merge pull request #4365 from gavinandresen/relax_isstandardGavin Andresen
Relax IsStandard rules for pay-to-script-hash transactions
2014-06-23Refactor proof of work related functions out of mainjtimon
2014-06-23Relax IsStandard rules for pay-to-script-hash transactionsGavin Andresen
Relax the AreInputsStandard() tests for P2SH transactions -- allow any Script in a P2SH transaction to be relayed/mined, as long as it has 15 or fewer signature operations. Rationale: https://gist.github.com/gavinandresen/88be40c141bc67acb247 I don't have an easy way to test this, but the code changes are straightforward and I've updated the AreInputsStandard unit tests.
2014-06-23build: fix build weirdness after 54372482.Cory Fields
bitcoin-config.h moved, but the old file is likely to still exist when reconfiguring or switching branches. This would've caused files to not rebuild correctly, and other strange problems. Make the path explicit so that the old one cannot be found. Core libs use config/bitcoin-config.h. Libs (like crypto) which don't want access to bitcoin's headers continue to use -Iconfig and #include bitcoin-config.h.