aboutsummaryrefslogtreecommitdiff
path: root/src/core.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODSPieter Wuille2014-09-021-11/+11
|
* Serializer simplifications after IMPLEMENT_SERIALIZE overhaulPieter Wuille2014-09-011-5/+2
|
* Merge pull request #4737Pieter Wuille2014-09-011-25/+62
|\ | | | | | | | | | | | | 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)
| * Use CSizeComputer to avoid counting sizes in SerializationOpPieter Wuille2014-08-311-44/+13
| |
| * rework overhauled serialization methods to non-staticKamil Domanski2014-08-311-65/+65
| | | | | | | | | | | | | | 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.
| * overhaul serialization codeKamil Domanski2014-08-311-50/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #4779Wladimir J. van der Laan2014-09-011-1/+1
|\ \ | |/ |/| | | 093303a add missing header end comments (Philip Kaufmann)
| * add missing header end commentsPhilip Kaufmann2014-08-281-1/+1
| | | | | | | | | | | | - 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
* | changed field types in some structures to equivalent unambiguous typesKamil Domanski2014-08-301-24/+24
|/ | | | | | | | Conflicts: src/core.cpp Rebased-By: Wladimir J. van der Laan Github-Pull: #4180
* Move `COIN` and `CENT` to core.hWladimir J. van der Laan2014-08-261-0/+3
| | | | | Eventually these should end up in `money.h` after monetary amounts are typedef'ed, but at least they don't belong in `util.h`.
* Remove print() from core functionsWladimir J. van der Laan2014-08-201-5/+1
| | | | Break dependency on util.
* Revert "Relay double-spends, subject to anti-DOS"Wladimir J. van der Laan2014-07-211-3/+0
| | | | This reverts commit d640a3ceab4f4372c2a0f738c1286cfde4b41b50.
* Move fee policy out of coreGavin Andresen2014-07-031-4/+2
|
* Use fee/priority estimates in wallet CreateTransactionGavin Andresen2014-07-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Relay double-spends, subject to anti-DOSTom Harding2014-06-271-0/+3
| | | | | | | | | | | | | | | | | | | | 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.
* Code simplifications after CTransaction::GetHash() cachingPieter Wuille2014-06-221-6/+0
|
* Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-31/+62
| | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* estimatefee / estimatepriority RPC methodsGavin Andresen2014-06-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New RPC methods: return an estimate of the fee (or priority) a transaction needs to be likely to confirm in a given number of blocks. Mike Hearn created the first version of this method for estimating fees. It works as follows: For transactions that took 1 to N (I picked N=25) blocks to confirm, keep N buckets with at most 100 entries in each recording the fees-per-kilobyte paid by those transactions. (separate buckets are kept for transactions that confirmed because they are high-priority) The buckets are filled as blocks are found, and are saved/restored in a new fee_estiamtes.dat file in the data directory. A few variations on Mike's initial scheme: To estimate the fee needed for a transaction to confirm in X buckets, all of the samples in all of the buckets are used and a median of all of the data is used to make the estimate. For example, imagine 25 buckets each containing the full 100 entries. Those 2,500 samples are sorted, and the estimate of the fee needed to confirm in the very next block is the 50'th-highest-fee-entry in that sorted list; the estimate of the fee needed to confirm in the next two blocks is the 150'th-highest-fee-entry, etc. That algorithm has the nice property that estimates of how much fee you need to pay to get confirmed in block N will always be greater than or equal to the estimate for block N+1. It would clearly be wrong to say "pay 11 uBTC and you'll get confirmed in 3 blocks, but pay 12 uBTC and it will take LONGER". A single block will not contribute more than 10 entries to any one bucket, so a single miner and a large block cannot overwhelm the estimates.
* Type-safe CFeeRate classGavin Andresen2014-06-061-7/+30
| | | | | | | | Use CFeeRate instead of an int64_t for quantities that are fee-per-size. Helps prevent unit-conversion mismatches between the wallet, relaying, and mining code.
* remove CTransaction::IsNewerThan which is never usedKamil Domanski2014-05-201-1/+0
|
* Merge pull request #3305 from mikehearn/fee_dropJeff Garzik2014-02-241-2/+2
|\ | | | | Drop fees by 10x due to the persistently higher exchange rate.
| * Drop fees by 10x due to the persistently higher exchange rate.Mike Hearn2013-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last fee drop was by 5x (from 50k satoshis to 10k satoshis) in the 0.8.2 release which was about 6 months ago. The current fee is (assuming a $500 exchange rate) about 5 dollar cents. The new fee after this patch is 0.5 cents. Miners who prefer the higher fees are obviously still able to use the command line flags to override this setting. Miners who choose to create smaller blocks will select the highest-fee paying transactions anyway. This would hopefully be the last manual adjustment ever required before floating fees become normal.
* | Add verbose boolean to getrawmempoolGavin Andresen2013-11-301-2/+5
| | | | | | | | | | Also changes mempool to store CTxMemPoolEntries to keep track of when they enter/exit the pool.
* | Refactor: move GetValueIn(tx) to tx.GetValueIn()Gavin Andresen2013-11-301-0/+9
|/ | | | GetValueIn makes more sense as a CTransaction member.
* Move CCoins-related logic to coins.{cpp.h}Pieter Wuille2013-11-101-228/+0
|
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-14/+17
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Generalize the remove-outputs check for fully-prunable transactions.Pieter Wuille2013-10-281-0/+3
| | | | | | | | | Instead of explicitly testing for the presence of any output, and dealing with this case specially, just interpret it as an empty CCoins. The case previously caught using the HaveCoins check, is now handled by the generic outs != outsBlock test.
* Move CBlockLocator to core.hPieter Wuille2013-10-151-0/+34
| | | | | As CBlockLocator is a P2P data structure, and independent from the validation logic, it can be moved to core.
* Skip unspendable outputs in consistency checkPieter Wuille2013-09-241-5/+9
|
* Prune provably-unspendable outputsPieter Wuille2013-07-101-1/+7
|
* Move core implementations to core.cppPieter Wuille2013-06-251-227/+22
|
* Moved CBlock from main.h to core.hEric Lombrozo2013-06-231-0/+123
|
* fix comment about dust logicCozz Lovan2013-06-111-2/+2
|
* Moved UpdateTime out of CBlockHeader and moved CBlockHeader into core.Eric Lombrozo2013-06-051-0/+61
|
* Moved CCoins, CTxOutCompressor, CTxInUndo, and CTxUndo to core.Eric Lombrozo2013-06-051-0/+332
|
* Removed AcceptToMemoryPool method from CTransaction. This method belongs to ↵Eric Lombrozo2013-06-051-1/+276
| | | | | | | | | | | | | | | | | the mempool instance. Removed AreInputsStandard from CTransaction, made it a regular function in main. Moved CTransaction::GetOutputFor to CCoinsViewCache. Moved GetLegacySigOpCount and GetP2SHSigOpCount out of CTransaction into regular functions in main. Moved GetValueIn and HaveInputs from CTransaction into CCoinsViewCache. Moved AllowFree, ClientCheckInputs, CheckInputs, UpdateCoins, and CheckTransaction out of CTransaction and into main. Moved IsStandard and IsFinal out of CTransaction and put them in main as IsStandardTx and IsFinalTx. Moved GetValueOut out of CTransaction into main. Moved CTxIn, CTxOut, and CTransaction into core. Added minimum fee parameter to CTxOut::IsDust() temporarily until CTransaction is moved to core.h so that CTxOut needn't know about CTransaction.
* Moved CInPoint to core. Removed GetMinFee from CTransaction and made it a ↵Eric Lombrozo2013-06-051-0/+15
| | | | regular function in main.
* Created core.h/core.cpp, added to makefiles. Started moving core structures ↵Eric Lombrozo2013-06-051-0/+53
from main to core beginning with COutPoint.