aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
AgeCommit message (Collapse)Author
2014-03-10Make mining fee policy match relay fee policy.Mike Hearn
This resolves a case in which a mismatch could be used to bloat up the mempool by sending transactions that pay enough fee to relay, but not to be mined, with the default policies.
2014-02-24Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan
Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h indirectly, so we cannot fix this with just macros. Trivial commit: apply the following script to all .cpp and .h files: # Middle sed -i 's/"PRIx64"/x/g' "$1" sed -i 's/"PRIu64"/u/g' "$1" sed -i 's/"PRId64"/d/g' "$1" # Initial sed -i 's/PRIx64"/"x/g' "$1" sed -i 's/PRIu64"/"u/g' "$1" sed -i 's/PRId64"/"d/g' "$1" # Trailing sed -i 's/"PRIx64/x"/g' "$1" sed -i 's/"PRIu64/u"/g' "$1" sed -i 's/"PRId64/d"/g' "$1" After this commit, `git grep` for PRI.64 should turn up nothing except the defines in util.h.
2014-02-09Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron
in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
2014-01-26Fix off-by-one errors in use of IsFinalTx()Peter Todd
Previously CreateNewBlock() didn't take into account the fact that IsFinalTx() without any arguments tests if the transaction is considered final in the *current* block, when both those functions really needed to know if the transaction would be final in the *next* block. Additionally the UI had a similar misunderstanding. Also adds some basic tests to check that CreateNewBlock() is in fact mining nLockTime-using transactions correctly. Thanks to Wladimir J. van der Laan for rebase.
2014-01-23Remove redundant .c_str()sWladimir J. van der Laan
After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
2013-12-19Make bitcoin compile without wallet if "db_cxx.h" is not presentThomas Holenstein
Moved includes of "db.h" into #ifdef ENABLE_WALLET blocks or remove them.
2013-12-13Merge pull request #3326Wladimir J. van der Laan
ad898b4 Increase default -blockmaxsize/prioritysize to 750K/50K (Gavin Andresen)
2013-12-09Move internal miner functionality togetherWladimir J. van der Laan
2013-12-09Allow mining RPCs with --disable-walletWladimir J. van der Laan
The following mining-related RPC calls don't use the wallet: - getnetworkhashps - getmininginfo - getblocktemplate - submitblock Enable them when compiling with --disable-wallet.
2013-11-30Add verbose boolean to getrawmempoolGavin Andresen
Also changes mempool to store CTxMemPoolEntries to keep track of when they enter/exit the pool.
2013-11-30Refactor: move GetValueIn(tx) to tx.GetValueIn()Gavin Andresen
GetValueIn makes more sense as a CTransaction member.
2013-11-30Increase default -blockmaxsize/prioritysize to 750K/50KGavin Andresen
2013-11-22setgenerate creates multiple blocks in -regtest modeGavin Andresen
I'm writing some wallet regression tests using -regtest mode, and need to generate an initial multi-hundred-block chain. Repeatedly calling setgenerate to generate one block is slow and doesn't work properly, because block creation happens asynchronously. This adds two features to setgenerate in -regtest mode: 1) Instead of being interpreted as number of threads to start, the third argument is the number of blocks to generate. 2) setgenerate will not return until the block creation threads have created the requested number of blocks.
2013-11-15core: remove includes in .cpp, if header is already in .hPhilip Kaufmann
- example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
2013-11-10Cleanup code using forward declarations.Brandon Dahler
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.
2013-11-04Refactor: CTxMempool class to its own txmempool.{cpp,h}Gavin Andresen
2013-10-20Merge pull request #3119Pieter Wuille
db0e8cc Bump Year Number to 2013 (super3)
2013-10-20Bump Year Number to 2013super3
2013-10-19Merge pull request #2945 from gmaxwell/fee-logic_encourage_sweepingGavin Andresen
[Fee logic] Don't count txins for priority to encourage sweeping.
2013-10-11Refactor/encapsulate chain globals into a CChain classPieter Wuille
2013-09-25internal miner: move 2 globals from main to minerPhilip Kaufmann
- moves 2 global variables from main.cpp/h to miner.cpp/h - also removes 2 unneded includes in miner.cpp, that come from miner.h already
2013-09-18Replace printf with LogPrintf / LogPrintGavin Andresen
2013-09-17[Fee logic] Don't count txins for priority to encourage sweeping.Gregory Maxwell
This changes the priority calculation to not include the size of per-txin data including up to 110 bytes of scriptsig so that transactions which sweep up extra UTXO don't lose priority relative to ones that don't. I'd toyed with some other variations, but it seems like any formulation which results in an incentive stronger than making them not count will sometimes create incentives to add extra outputs so that you have extra inputs to consume later. The maximum credit is limited so that users don't lose the disincentive to stuff random data in their transactions, the limit of 110 is based on the size of a P2SH redemption with a compressed public key. This shouldn't need a staged deployment because the priority is not used as a relay criteria, only a mining criteria.
2013-08-25miner: constify CreateNewBlock() arg scriptPubKeyInJeff Garzik
2013-08-24CreateNewBlock() now takes scriptPubKey argument,Jeff Garzik
rather than a key. CreateNewBlockWithKey() helper is added to restore existing functionality, making this an equivalent-transformation change.
2013-07-31Move internal miner/block creation to separate miner.cpp module.Jeff Garzik
Public functions referenced elsewhere are added to miner.h.