aboutsummaryrefslogtreecommitdiff
path: root/src/node/miner.h
AgeCommit message (Collapse)Author
2022-09-09scripted-diff: rename CChainState -> ChainstateJames O'Beirne
-BEGIN VERIFY SCRIPT- sed -i 's/CChainState/Chainstate/g' $(git grep -l CChainState ':(exclude)doc/release-notes*') -END VERIFY SCRIPT- Co-authored-by: MacroFake <falke.marco@gmail.com>
2022-06-06miner: Make mempool optional for BlockAssemblerCarl Dong
...also adjust callers Changes: - In BlockAssembler::CreateNewBlock, we now only lock m_mempool->cs and call addPackageTxs if m_mempool is not nullptr - BlockAssembler::addPackageTxs now takes in a mempool reference, and is annotated to require that mempool's lock. - In TestChain100Setup::CreateBlock and generateblock, don't construct an empty mempool, just pass in a nullptr for mempool
2022-05-27miner: Make UpdatePackagesForAdded staticCarl Dong
Since UpdatePackagesForAdded is a helper function that's only used in addPackageTxs we can make it static and avoid the unnecessary interface and in-header lock annotation.
2022-05-27miner: Absorb SkipMapTxEntry into addPackageTxsCarl Dong
SkipMapTxEntry is a short helper function that's only used in addPackageTxs, we can just inline it, keep the comments, and avoid the unnecessary interface and lock annotations.
2022-05-18Do not pass CChainParams& to BlockAssembler constructorMacroFake
2022-05-06Merge bitcoin/bitcoin#24538: miner: bug fix? update for ancestor inclusion ↵MacroFake
using modified fees, not base e4303c337c8423f21c2c72ee1bcca3aaf46fa1cb [unit test] prioritisation in mining (glozow) 7a8d60676bc0eec289687b2dfd5d2b00b83c0eaa [miner] bug fix: update for parent inclusion using modified fee (glozow) 0f9a44461c294cf21a335e8a8c13e498baac110f MOVEONLY: group miner tests into MinerTestingSetup functions (glozow) Pull request description: Came up while reviewing #24364, where some of us incorrectly assumed that we use the same fee deduction in `CTxMemPoolModifiedEntry::nModFeesWithAncestors` when first constructing an entry and in `update_for_parent_inclusion`. Actually, the behavior is this: when a mempool entry's ancestor is included in the block template, we create a `CTxMemPoolModifiedEntry` for it, subtracting the ancestor's modified fees from `nModFeesWithAncestors`. If another ancestor is included, we update it again, but use the ancestor's _base_ fees instead. I can't explain why we use `GetFee` in one place and `GetModifiedFee` in the other, but I'm quite certain we should be using the same one for both. And should it be base or modified fees? Modified, otherwise the child inherits the prioritisation of the parent, but only until the parent gets mined. If we want prioritisation to cascade down to current in-mempool descendants, we should probably document that in the `prioritsetransaction` helpstring and implement it in `CTxMemPool::mapDeltas`, not as a quirk in the mining code? Wrote a test in which a mempool entry has 2 ancestors, both prioritised, and both included in a block template individually. This test should fail without the s/GetFee/GetModifiedFee commit. ACKs for top commit: ccdle12: tested ACK e4303c3 MarcoFalke: ACK e4303c337c8423f21c2c72ee1bcca3aaf46fa1cb 🚗 Tree-SHA512: 4cd94106fbc9353e9f9b6d5af268ecda5aec7539245298c940ca220606dd0737264505bfaae1f83d94765cc2d9e1a6e913a765048fe6c19292482241761a6762
2022-04-01Remove buggy and confusing IncrementExtraNonceMarcoFalke
2022-03-21Use CAmount for fee delta and modified feeMarcoFalke
2022-03-14[miner] bug fix: update for parent inclusion using modified feeglozow
2022-02-23[miner] always assume we can create witness blocksglozow
Given the low possibility of a reorg reverting the segwit soft fork, there is no need to check whether segwit is active here. Also, TestBlockValidity is run on the block template after it has been created.
2022-01-06Add src/node/* code to node:: namespaceRussell Yanofsky
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-12-01miner: Remove uncompiled MTP codeMarcoFalke
2021-12-01style: Add {} to if-bodies in node/minerMarcoFalke
Can be reviewed with --word-diff-regex=. --ignore-all-space
2021-11-16refactor: Replace validation.h include with forward-decl in miner.hMarcoFalke
2021-11-16scripted-diff: Move miner to src/nodeMarcoFalke
-BEGIN VERIFY SCRIPT- # Move module git mv src/miner.cpp src/node/ git mv src/miner.h src/node/ # Replacements sed -i 's:miner\.h:node/miner.h:g' $(git grep -l miner) sed -i 's:miner\.cpp:node/miner.cpp:g' $(git grep -l miner) sed -i 's:MINER_H:NODE_MINER_H:g' $(git grep -l MINER_H) -END VERIFY SCRIPT-