Commit graph

48 commits

Author SHA1 Message Date
Michi Lumin d84837a838 Cherry-pick from Bitcoin repo, 1ec0c0a: small changes for OSX build
Cherry-pick from Bitcoin repo, 1ec0c0a: adds "const" suffix to several lines in txmempool.h and miner.h to make this build succeed under OSX w. clang++ and Boost lib 1.66+
2019-03-25 05:36:12 +00:00
Ross Nicoll fcde864334 Sync mining code from Namecore to resolve unit test failures (#1385) 2018-09-19 19:23:29 +01:00
Suhas Daftuar a296c6009f Update benchmarking with package statistics
Github-Pull: #9959
Rebased-From: 011124a2b2
2017-03-30 15:18:02 -04:00
Suhas Daftuar 569596cc51 Don't require segwit in getblocktemplate for segwit signalling or mining
Segwit's version bit will be signalled for all invocations of CreateNewBlock,
and not specifying segwit only will cause CreateNewBlock to skip transactions
with witness from being selected.

Github-Pull: #9955
Rebased-From: abe7b3d3ab
2017-03-16 10:43:54 -04:00
Alex Morcos daec955fd6 Introduce -blockmintxfee 2017-01-04 13:24:19 -05:00
isle2983 27765b6403 Increment MIT Licence copyright header year on files modified in 2016
Edited via:

$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Wladimir J. van der Laan 744d2652dd
Merge #8223: [c++11] Use std::unique_ptr for block creation.
9fce062 [c++11] Use std::unique_ptr for block creation. (Daniel Kraft)
2016-10-18 21:16:08 +02:00
Suhas Daftuar 2c06bae39e Rename "block cost" to "block weight" 2016-07-18 13:28:26 -04:00
Suhas Daftuar 27362dda4d Remove -blockminsize option 2016-06-30 11:41:13 -04:00
Suhas Daftuar d2e46e1b5c Remove addScoreTxs() 2016-06-30 11:37:38 -04:00
Suhas Daftuar 6dd4bc289c Exclude witness transactions in addPackageTxs() pre-segwit activation 2016-06-30 11:24:32 -04:00
Suhas Daftuar f15c2cde45 CreateNewBlock: add support for size-accounting to addPackageTxs
Includes a change to not continue to use size-accounting in addScoreTxs
or addPackageTxs just because addPriorityTxs() is used.
2016-06-27 10:58:58 -04:00
Pieter Wuille 2b1f6f9ccf BIP141: Other consensus critical limits, and BIP145
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
2016-06-22 15:43:00 +02:00
Pieter Wuille 8b49040854 BIP141: Commitment structure and deployment
Includes a fix by Suhas Daftuar and LongShao007
2016-06-22 15:42:59 +02:00
Daniel Kraft 9fce0629b4 [c++11] Use std::unique_ptr for block creation.
CreateNewBlock returns a pointer for which the caller takes ownership.
Use std::unique_ptr to make this explicit and simplify handling of these
objects in getblocktemplate.
2016-06-18 19:38:28 +02:00
Suhas Daftuar c82a4e9a63 Use ancestor-feerate based transaction selection for mining
Includes changes by Pieter Wuille
2016-06-16 12:35:37 -04:00
Alex Morcos 4dc94d1036 Refactor CreateNewBlock to be a method of the BlockAssembler class 2016-05-18 14:11:12 -04:00
Leviathn 8d1de43f0c Remove internal miner
This code removes the internal miner which is only useful on Testnet.
This leaves the internal miner that is useful on RegTest intact.
2016-02-10 18:29:13 -08:00
MarcoFalke fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
Luke Dashjr b966aa836a Constrain constant values to a single location in code 2015-11-28 18:47:29 +01:00
Jorge Timón 6bc9e4056b Chainparams: Explicit CChainParams arg for miner:
-BitcoinMiner
-CreateNewBlock
-GenerateBitcoins
-ProcessBlockFound
2015-11-11 13:21:17 +01:00
Luke Dashjr 5f9260f458 Bugfix: If genproclimit is omitted to RPC setgenerate, don't change it; also show correct default in getmininginfo 2015-10-01 23:16:42 +00:00
Daniel Kraft 69c3bde448 Add some const declarations where they are appropriate.
Declare some arguments of functions as "const" pointers where they are
not meant to be modified.
2015-08-08 18:18:41 +02:00
Wladimir J. van der Laan 2f746c6e8a
Merge pull request #6177
ef8dfe4 Prevent block.nTime from decreasing (Mark Friedenbach)
2015-08-06 12:01:21 +02:00
Jonas Schnelli d0fc10a844 detach wallet from miner 2015-06-30 21:45:46 +02:00
Mark Friedenbach ef8dfe41d1 Prevent block.nTime from decreasing
Under some circumstances it is possible for there to be a significant,
discontinuous jump in a node's clock value. On mining nodes, this can
result in block templates which are no longer valid due to time-based
nLockTime constraints. UpdateTime() is modified so that it will never
decrease a block's nLockTime, thereby preventing such invalidations.
2015-05-27 14:03:11 -07:00
Jonas Schnelli 30c43d9821 miner.h: fix clang warning because of class/struct mix
- class 'Params' was previously declared as a struct
2015-04-16 10:32:47 +02:00
Jorge Timón bebe7282ff Chainparams: Refactor: Remove redundant AllowMinDifficultyBlocks() getter 2015-04-15 14:31:44 +02:00
Wladimir J. van der Laan 48265f3cf4 Revert mining changes in #5957
This reverts commit e2edf95cd3 6b04508e37 0df67f1f7a,
except the changes to the RPC tests.

A `generate` RPC call is introduced based on the old code.
2015-04-10 07:51:27 +02:00
Pieter Wuille e2edf95cd3 Bugfix: make CreateNewBlock return pindexPrev 2015-04-01 11:47:10 -07:00
Pieter Wuille 6b04508e37 Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
Wladimir J. van der Laan 40e96a3016
Merge pull request #5599
0cc0d8d Get rid of the internal miner's hashmeter (jtimon)
2015-01-24 16:00:40 +01:00
Luke Dashjr 2ce63d395f MOVEONLY: Move struct CBlockTemplate to miner.h (from main.h) 2015-01-12 20:47:44 +01:00
jtimon 0cc0d8d60b Get rid of the internal miner's hashmeter 2015-01-04 21:04:55 +01:00
Wladimir J. van der Laan 269d8ba0d2
Remove declaration of no longer existent CheckWork
Also make ProcessBlockFound static as it is not used outside
miner.cpp.

Alternative implementation of #5549.
2015-01-02 17:30:00 +01:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Michael Ford 78253fcbad Remove references to X11 licence 2014-12-16 15:56:50 +08:00
jtimon 22c4272bf4 MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include main.h -> chain.h) 2014-10-29 21:00:05 +01:00
Pieter Wuille 85aab2a088 Switch miner.cpp to use sha2 instead of OpenSSL. 2014-06-21 19:47:39 +02:00
Philip Kaufmann ac14bcc1f1 small formatting, indentation and comment fixes
- contains zero code changes
2014-06-10 18:23:56 +02:00
Gavin Andresen c8b74258ba setgenerate creates multiple blocks in -regtest mode
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-22 09:51:13 +10:00
Gavin Andresen 3a6faabecf Fix struct/class declaration mismatches 2013-11-11 10:15:43 +10:00
Brandon Dahler 51ed9ec971 Cleanup code using forward declarations.
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-10 09:36:28 -06:00
super3 db0e8ccd90 Bump Year Number to 2013 2013-10-20 15:25:06 -04:00
Philip Kaufmann 8d750f1d21 internal miner: move 2 globals from main to miner
- 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-25 15:48:11 +02:00
Jeff Garzik f1dbed9233 miner: constify CreateNewBlock() arg scriptPubKeyIn 2013-08-25 20:16:23 -04:00
Jeff Garzik 7e17018995 CreateNewBlock() now takes scriptPubKey argument,
rather than a key.

CreateNewBlockWithKey() helper is added to restore existing functionality,
making this an equivalent-transformation change.
2013-08-24 00:33:46 -04:00
Jeff Garzik d247a5d130 Move internal miner/block creation to separate miner.cpp module.
Public functions referenced elsewhere are added to miner.h.
2013-07-31 09:43:35 -04:00