Commit graph

33886 commits

Author SHA1 Message Date
MacroFake
a2a8e919ee
Merge bitcoin/bitcoin#24925: refactor: make GetRand a template, remove GetRandInt
ab1ea29ba1 refactor: make GetRand a template, remove GetRandInt (pasta)

Pull request description:

  makes GetRand a template for which any integral type can be used, where the default behavior is to return a random integral up to the max of the integral unless a max is provided.
  This simplifies a lot of code from GetRand(std::numeric_limits<uint64_t>::max() -> GetRand<uint64_t>()

ACKs for top commit:
  laanwj:
    Code review ACK ab1ea29ba1

Tree-SHA512: db5082a0e21783389f1be898ae73e097b31ab48cab1a2c0e29348a4adeb545d4098193aa72a547c6baa6e8205699aafec38d6a27b3d65522fb3246f91b4daae9
2022-05-12 08:57:22 +02:00
laanwj
51527ec1ec
Merge bitcoin/bitcoin#25051: Bugfix: configure: Define defaults for enable_arm_{crc,shani}
7fd0860d12 Bugfix: configure: Define defaults for enable_arm_{crc,shani} (Luke Dashjr)

Pull request description:

  Fix for #17398 and #24115

  Trivial, mostly for consistency (you'd have to *try* to break this)

ACKs for top commit:
  pk-b2:
    ACK 7fd0860d12
  seejee:
    ACK 7fd0860d12
  vincenzopalazzo:
    ACK 7fd0860d12

Tree-SHA512: 51c389787c369f431ca57071f03392438bff9fd41f128c63ce74ca30d2257213f8be225efcb5c1329ad80b714f44427d721215d4f848cc8e63060fa5bc8f1f2e
2022-05-11 20:24:27 +02:00
Anthony Towns
436ce0233c sync.h: strengthen AssertLockNotHeld assertion 2022-05-12 02:25:56 +10:00
Anthony Towns
7d73f58e9c Increase threadsafety annotation coverage 2022-05-12 02:25:55 +10:00
MacroFake
9db941d773
Merge bitcoin/bitcoin#25100: Switch scheduler to steady_clock
fa90516422 Switch scheduler to steady_clock (MacroFake)

Pull request description:

  There is already `mockscheduler`, so it seems brittle, confusing and redundant to be able to mock the scheduler by adjusting the system clock.

ACKs for top commit:
  laanwj:
    Code review ACK fa90516422
  w0xlt:
    crACK fa90516422

Tree-SHA512: 60e99065ffb881a9fb25a346d311d99424fbc72a3b636c94b5f5c17ed6373c40f358a9b27825c518d12968c033e6cfd3c62d2b62cacdddc44a0b5b74f6c1a7ae
2022-05-11 17:18:25 +02:00
MacroFake
cca900e382
Merge bitcoin/bitcoin#25104: wallet: Change log interval to use steady_clock
bdc6881e2f wallet: Change log interval to use `steady_clock` (w0xlt)

Pull request description:

  This refactors the log interval variables to use `steady_clock` as it is best suitable for measuring intervals.

ACKs for top commit:
  laanwj:
    This makes sense. Code review ACK bdc6881e2f
  dunxen:
    Code review ACK bdc6881

Tree-SHA512: 738b4aa45cef01df77102320f83096a0a7d0c63d7fcf098a8c0ab16b29453a87dc789c110105590e1e215d03499db1d889a94f336dcb385b6883c8364c9d39b7
2022-05-11 17:09:44 +02:00
MacroFake
fab9e8a29c
Remove unused GetTimeSeconds 2022-05-11 16:39:23 +02:00
MacroFake
27d7b11e8c
Merge bitcoin/bitcoin#25106: rpc: dumptxoutset: check fopen return code
9feb887082 rpc: check `fopen` return code in dumptxoutset (Sebastian Falbesoner)

Pull request description:

  This change improves the usability of the `dumptxoutset` RPC in two ways, in the case that an invalid path is passed:
  1. return from the RPC immediately, rather then when the file is first tried to be written (which is _after_ calculating the UTXO set hash)
  2. return a proper return code and error message instead of the cryptic message that appears on master currently (see below)

  master branch:
  (error message appears after several minutes on my machine)
  ```
  $ ./src/bitcoin-cli dumptxoutset /invalid/path
  error code: -1
  error message:
  CAutoFile::operator<<: file handle is nullptr: unspecified iostream_category error
  ```

  PR branch:
  (error message appears immediately)
  ```
  $ ./src/bitcoin-cli dumptxoutset /invalid/path
  error code: -8
  error message:
  Couldn't open file /invalid/path.incomplete for writing.
  ```

ACKs for top commit:
  w0xlt:
    Code Review ACK 9feb887082

Tree-SHA512: e8695a7e86f26cc3b086d6bc6888388061f1dee439f76409b3ee11d35032bfd9cfa5349b728cd7f45bcffd999ecf9a6a991be172ce587b9b14503d9916b6e984
2022-05-11 16:32:45 +02:00
Sebastian Falbesoner
9feb887082 rpc: check fopen return code in dumptxoutset
This change improves the usability of the `dumptxoutset` RPC in two ways,
in the case that an invalid path is passed:
  1. return from the RPC immediately, rather then when the file is first
     tried to be written (which is _after_ calculating the UTXO set hash)
  2. return a proper return code and error message instead of the cryptic
     "CAutoFile::operator<<: file handle is nullptr: unspecified
      iostream_category error" (-1)
2022-05-11 16:03:40 +02:00
fanquake
b8ded26ef3
Merge bitcoin/bitcoin#25090: doc: Explain Bitcoin Core instead of Bitcoin in README.md
faeb5b59a0 doc: Explain Bitcoin Core in README.md (MacroFake)

Pull request description:

  Currently the README doesn't explain what Bitcoin Core is. Fix that.

  Further reading / Inspired by:

  * https://github.com/bitcoin/bitcoin/pull/25012
  * https://github.com/bitcoin-core/bitcoincore.org/pull/783
  * https://github.com/bitcoin-core/bitcoincore.org/pull/784

ACKs for top commit:
  laanwj:
    re-ACK faeb5b59a0
  brunoerg:
    ACK faeb5b59a0
  1440000bytes:
    ACK faeb5b59a0
  w0xlt:
    ACK faeb5b59a0

Tree-SHA512: f9a9460853487a46ba0219d26cefa1fcf8d650deb3c2656737a54648016af0cdac58c5d4641a390be8c05f3e78185bd99801e239fcb87d410c4df31f61bc7016
2022-05-11 07:23:25 +01:00
w0xlt
bdc6881e2f wallet: Change log interval to use steady_clock
This refactors the log interval variables to use `steady_clock`
as it is best suitable for measuring intervals.
2022-05-10 21:12:52 -03:00
Jon Atack
654284209f Add clang lifetimebound section to developer notes 2022-05-10 16:29:26 +02:00
Jon Atack
e66b321fd1 Add C++ functions and methods section to developer notes
Credit for some parts to the Google C++ Style Guide "Inputs and Outputs"
section at https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs

Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com>
2022-05-10 14:57:50 +02:00
laanwj
ed4eeafbb6
Merge bitcoin/bitcoin#24793: test: Change color of skipped functional tests
3258bad996 changes color of skipped functional tests (Jacob P. Fickes)

Pull request description:

  changes the color of skipped functional tests (currently grey and can be hard to read/invisible on dark backgrounds) to yellow.

  resolves #24791

ACKs for top commit:
  theStack:
    Tested ACK 3258bad996
  jarolrod:
    Tested ACK 3258bad996

Tree-SHA512: 3fe5ae0d3b4902b2b6bda6e89ab780feb8bf4b7cb1ce7e8467057b94a1e0a26ddeaf3cac0bc19b06ef10d8bccaac9c495029d42740fbedab8fb0d5fdd7d02eaf
2022-05-10 13:12:38 +02:00
MacroFake
fa90516422
Switch scheduler to steady_clock 2022-05-10 10:54:54 +02:00
MacroFake
fb7c12c26f
Merge bitcoin/bitcoin#24921: Add time helpers for std::chrono::steady_clock and FastRandomContext::rand_uniform_delay
fa4fb8d98b random: Add FastRandomContext::rand_uniform_delay (MarcoFalke)
faa5c62967 Add time helpers for std::chrono::steady_clock (MarcoFalke)

Pull request description:

  A steady clock can be used in the future for the scheduler, for example.

  A random uniform delay applied to a time point can be used in the future for time points passed to the scheduler, or delays in net processing.

  Currently they are unused outside of tests, but if they turn out unused in the future (unlikely), they can trivially be removed again. I am splitting them out, so that several branches/pulls can build on top of them without duplicating the commits.

ACKs for top commit:
  ajtowns:
    ACK fa4fb8d98b

Tree-SHA512: 2c37174468fe84b1cdf2a032f458706df44b99a5f99062417bb42078b6f69e2f1738d20c21cd9386ca5a35f3bc0583e547ba40168c66f6aa42f700ba35dd95d4
2022-05-10 07:56:06 +02:00
MacroFake
faeb5b59a0
doc: Explain Bitcoin Core in README.md 2022-05-10 07:49:09 +02:00
MacroFake
967654d079
Merge bitcoin/bitcoin#25079: index: Change sync variables to use std::chrono::steady_clock
92b35aba22 index, refactor: Change sync variables to use `std::chrono::steady_clock` (w0xlt)

Pull request description:

  This PR refactors the sync variables to use `std::chrono::steady_clock` as it is best suitable for measuring intervals.

ACKs for top commit:
  jonatack:
    utACK 92b35aba22
  ajtowns:
    ACK 92b35aba22 - code review only

Tree-SHA512: cd4bafde47b30beb88c0aac247e41b4dced2ff2845c67a7043619da058dcff4f84374a7c704a698f3055c888d076d25503c2f38ace8fbc5456f624e0efe1e188
2022-05-10 07:35:36 +02:00
Anthony Towns
bb5c24b120 validation: move g_versionbitscache into ChainstateManager 2022-05-10 12:09:33 +10:00
Anthony Towns
eca22c726a test/versionbits: make versionbitscache a parameter 2022-05-10 12:09:33 +10:00
Anthony Towns
d603f1d8a7 deploymentstatus: make versionbitscache a parameter 2022-05-10 12:09:33 +10:00
Anthony Towns
78adef1753 refactor: use chainman instead of chainParams for DeploymentActive* 2022-05-10 12:09:33 +10:00
Anthony Towns
deffe0df6c deploymentstatus: allow chainman in place of consensusParams 2022-05-10 12:09:33 +10:00
Anthony Towns
eaa2e3f25c validation: move UpdateUncommittedBlockStructures and GenerateCoinbaseCommitment into ChainstateManager 2022-05-10 12:09:33 +10:00
Anthony Towns
5c67e84d37 validation: replace ::Params() calls with chainstate/chainman member 2022-05-10 12:09:33 +10:00
Anthony Towns
38860f93b6 validation: remove redundant CChainParams params from ChainstateManager methods 2022-05-10 12:09:33 +10:00
Anthony Towns
69675ea4e7 validation: add CChainParams to ChainstateManager 2022-05-10 12:09:27 +10:00
Hennadii Stepanov
b9219b233f
Merge bitcoin-core/gui#590: refactor: Declare WalletModel member functions with const
f70ee34c71 qt, refactor: Declare `WalletModel` member functions with `const` (Hennadii Stepanov)

Pull request description:

  After bitcoin/bitcoin#12830 the `WalletModel` class has two member functions: be7a5f2fc4/src/qt/walletmodel.h (L81) and be7a5f2fc4/src/qt/walletmodel.h (L154)

  This PR drops the former one as redundant, and declares `WalletModel` member functions with the `const` qualifier where appropriate.

ACKs for top commit:
  promag:
    Code review ACK f70ee34c71.
  kristapsk:
    cr ACK f70ee34c71
  w0xlt:
    Code Review ACK f70ee34c71

Tree-SHA512: 43e6661822c667229ea860fb94c2e3154c33773dbd9fca1f6f76cc31c5875a1a0e8caa65ddfc20dec2a43e29e7b2469b3b6fa148fe7ec000ded518b4958b2b38
2022-05-09 22:33:58 +02:00
fanquake
298389e3b5
guix: bump time-machine to 998eda3067c7d21e0d9bb3310d2f5a14b8f1c681
There are two reasons to perform this bump:
* Fixes #25082 by bumping to a commit that includes a fix for time-dependent unit
tests in libgit2 (f5fe0082abe4547f3fb9f29d8351473cfb3a387b).
* Gives us access to clang-toolchain-14 (14.0.3, 998eda3067c7d21e0d9bb3310d2f5a14b8f1c681),
which is useful for the Guix portion of #21778.

Note that with this bump:
Linux kernels headers update from 5.15.28 to 5.15.37.
2022-05-09 21:23:53 +01:00
Hennadii Stepanov
3dd95cb5c2
Merge bitcoin-core/gui#591: test: Add tests for tableView in AddressBookPage dialog
15069130c6 qt, test: Add tests for `tableView` in `AddressBookPage` dialog (Hennadii Stepanov)
edae3ab699 qt: No need to force Qt::QueuedConnection for NotifyAddressBookChanged (Hennadii Stepanov)

Pull request description:

  This PR is a prerequisite for more thorough testing of filtering in the `AddressBookPage` class in context of bitcoin-core/gui#578 and bitcoin-core/gui#585.

  Required for bitcoin-core/gui#592.

ACKs for top commit:
  promag:
    Code review ACK 15069130c6.

Tree-SHA512: 86986d47606cbd54d813436c7afb21894e2200b6d3042a7aa0b5e84821c765bd68b14ad38a445069891ab33f2d7bcd4933b8373e14e9afb0c91f1a6ddf4da740
2022-05-09 22:19:39 +02:00
Jon Atack
ca1ac1f0e0 scripted-diff: Rename MainSignalsInstance() class to MainSignalsImpl()
```
-BEGIN VERIFY SCRIPT-
s() { git grep -l "$1" src test doc | xargs sed -i "s/$1/$2/g"; }
s 'MainSignalsInstance' 'MainSignalsImpl'
-END VERIFY SCRIPT-
2022-05-09 18:35:44 +02:00
Jon Atack
2aaec2352d refactor: remove unused forward declarations in validationinterface.h 2022-05-09 18:33:40 +02:00
Jon Atack
23854f8402 refactor: make MainSignalsInstance() a class
and use Doxygen documentation for it, per our developer notes.

Context:

MainSignalsInstance was created in 3a19fed9db and originally was a struct
collection of boost::signals methods moved to validationinterface.cpp, in order
to no longer need to include boost/signals in validationinterface.h.

MainSignalsInstance then evolved in d6815a2313 to remove boost/signals2 and became class-like.

[C.8: Use class rather than struct if any member is
non-public](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-class)

[C.2: Use class if the class has an invariant; use struct if the data members can vary
independently](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c2-use-class-if-the-class-has-an-invariant-use-struct-if-the-data-members-can-vary-independently)

A class also has the advantage of default private access, as opposed to public for a struct.
2022-05-09 18:33:32 +02:00
Jon Atack
5fca70f5b1 Link in developer notes style to internal interface exception 2022-05-09 16:14:04 +02:00
Jon Atack
fc4cb857cc Prefer Python for scripts in developer notes
along with a few miscellaneous touch-ups.
2022-05-09 16:13:38 +02:00
MacroFake
a8098f2cef
Merge bitcoin/bitcoin#25091: test: Remove extended lint (cppcheck)
efae252f30 test: Remove extended lint (cppcheck) (laanwj)

Pull request description:

  These are unreferenced in the CI and documentation, and have been since 2019 (see #17549).

  I'm not sure the cppcheck is worthwhile. It takes a long time to run (I think this is why it isn't in the normal lints), and right
  now it only appears to find implicit constructors. The list of exceptions is out of date. But if anyone wants to bring it back at any
  time in the future they can do so from git history (and port it to Python).

ACKs for top commit:
  fanquake:
    ACK efae252f30

Tree-SHA512: 1a770b5d20ff1199d0d6bc471ae3d2c3438f0f0b169ce8d2fe73480daf8d3a7146c066b799afc90aa7898982c5fee79c1daca10e16e2bff0a7b38850aedd55b2
2022-05-09 15:08:33 +02:00
laanwj
efae252f30 test: Remove extended lint (cppcheck)
These are unreferenced in the CI and documentation, and have been since
2019 (see #17549).

I'm not sure the cppcheck is worthwhile. It takes a long time
to run (I think this is why it isn't in the normal lints), and right
now it only appears to find implicit constructors. The list of
exceptions is out of date. But if anyone wants to bring it back at any
time in the future they can do so from git history (and port it to Python).
2022-05-09 15:01:00 +02:00
MacroFake
dab18f03f7
Merge bitcoin/bitcoin#24946: Unroll the ChaCha20 inner loop for performance
81c09ee45c Unroll the ChaCha20 inner loop for performance (Pieter Wuille)

Pull request description:

  Unrolling the inner ChaCha20 loop gives a ~15% speedup for me in the CHACHA20_* benchmarks. It's a simple change, this performance helps with RNG generation, and will matter more for BIP324.

ACKs for top commit:
  martinus:
    tested ACK  81c09ee with clang++ 13.0.1, test `CHACHA20_1MB`:
  MarcoFalke:
    ACK 81c09ee45c 🍟

Tree-SHA512: 108bd0ba573bb08de92d611e7be7c09a2c2700f9655f44129b87f9b71f7e101dfc6bd345783e7b4b9b40f0b003913cf59187f422da8cdb5b20887f7855b2611a
2022-05-09 13:56:36 +02:00
fanquake
8abe79aedd
Merge bitcoin/bitcoin#25078: doc: Shorten explanation of "maintainers"
fa32ced49c doc: Shorten explanation of "maintainers" (MacroFake)

Pull request description:

  GitHub has an extensive documentation about permissions ( https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role ), so I don't think we should be trying to mirror them here.

  Specifically, this pull makes three changes:

  * Clarify that all "merge maintainers" can merge pull requests. Obviously, while GitHub users with the `Maintain` permission can not force push to protected branches, and GitHub users with the `Admin` permission can, I don't think this is worthy to mention in the contribution guidelines. During the whole time I was working on the project, I think this permission was only used once or twice, when I accidentally pushed an unsigned draft commit directly to `master`. See https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2016-06-13#473584 . One could argue that there should be a list of maintainers in the doc. Though, as there is already a list of keys for verify-commits, this seems like unnecessary overhead.
  * Clarify that the release process is executed collectively by the developers. For example, release process code changes that are reproducible can be done by anyone without permission. Also, detached signatures are created by several people (see for example https://github.com/bitcoin-core/bitcoin-detached-sigs/commits/23.0), which (I believe) are also separate from the people that can push the binaries to the `bin` folder, which again are separate from the people who can release the snap/flatpak package.
  * Clarify that moderation is also done collectively by people with `Triage`, `Write`, `Maintain`, and `Admin` permission. I think it is fine to refer to everyone in that group as "maintainers", or at least don't clarify it further, as any attempt at that would start to duplicate GitHub docs.

ACKs for top commit:
  laanwj:
    ACK fa32ced49c
  prusnak:
    Approach ACK fa32ced49c
  fanquake:
    ACK fa32ced49c

Tree-SHA512: ed87c2e538a32ff1611208a7262425160a4340a3112a1b2712d7e9a550fa191ddbebea0d8e45d3e578ead02d5ef17bddcaab3f6ee876f9018a5acbc65ffd0e1c
2022-05-09 10:56:28 +01:00
Luke Dashjr
ba10b90915 Wallet: Ensure m_attaching_chain is set before registering for signals
Avoids a race where chainStateFlushed could be called before rescanning began, yet rescan gets interrupted or fails
2022-05-09 01:54:16 +00:00
MarcoFalke
fa4fb8d98b
random: Add FastRandomContext::rand_uniform_delay 2022-05-08 11:47:55 +02:00
MarcoFalke
faa5c62967
Add time helpers for std::chrono::steady_clock 2022-05-08 11:47:45 +02:00
w0xlt
92b35aba22 index, refactor: Change sync variables to use std::chrono::steady_clock
This refactors the sync variables to use `std::chrono::steady_clock`
as it is best suitable for measuring intervals.
2022-05-08 04:02:33 -03:00
avirgovi
2a22f034ca parsing external signer master fingerprint string as bytes instead of caring for lower/upper case in ExternalSigner::SignTransaction 2022-05-07 11:09:52 +02:00
Jon Atack
370120ec2f Remove obsolete BDB ENABLE_WALLET section in developer notes 2022-05-06 18:29:59 +02:00
MacroFake
fa32ced49c
doc: Shorten explanation of "maintainers" 2022-05-06 16:49:01 +02:00
MacroFake
59ac8bacd5
Merge bitcoin/bitcoin#24804: Sanity assert GetAncestor() != nullptr where appropriate
308dd2e93e Sanity assert GetAncestor() != nullptr where appropriate (Adam Jonas)

Pull request description:

  Re-opening #17232. I have rebased the PR and addressed jonatack's nit suggestions.

  Add sanity asserts for return value of `CBlockIndex::GetAncestor()` where appropriate.

  In validation.cpp `CheckSequenceLocks`, check the return value of `tip->GetAncestor(maxInputHeight)` stored into `lp->maxInputBlock`. If it ever returns `nullptr` because the ancestor isn't found, it's going to be a bad bug to keep going, since a `LockPoints` object with the `maxInputBlock` member set to `nullptr` signifies no relative lock time.

  In the other places, the added asserts would prevent accidental dereferencing of a null pointer which is undefined behavior.

  Co-Authored-By: Adam Jonas <jonas@chaincode.com>
  Co-Authored-By: danra <danra@users.noreply.github.com>

ACKs for top commit:
  jonatack:
    ACK 308dd2e93e

Tree-SHA512: 5bfdaab1499607ae2c3cd3e2e9e8c37850bfd0e327e680f4e36c81f9c6d98a543af78ecfac1ab0e06325d264412615a04d52005875780c7db2a4d81bd2d2259a
2022-05-06 11:46:20 +02:00
MacroFake
77a9997d97
Merge bitcoin/bitcoin#25063: test: previous releases: add v23.0
dba1231672 test: previous releases: add v23.0 (Sjors Provoost)

Pull request description:

  Follows the same pattern as d8b705f1ca (v22.0) and 8a57a06a50 (v0.21.0).

  Starting from v23.0 there is a separate macOS release for x86_64 and aarch64.

ACKs for top commit:
  prusnak:
    Approach ACK dba1231672

Tree-SHA512: 249aeddd5e80e163578581e5c8e9b6579f3694abc3d1fb68dddb7b42d75021ad85266688ec4a365a6631d82a65a19873aff7ba61c0ea59d21f8adbe4b772dc16
2022-05-06 11:38:03 +02:00
MacroFake
b557a24be9
Merge bitcoin/bitcoin#19426: refactor: Change * to & in MutableTransactionSignatureCreator
fac6cfc50f refactor: Change * to & in MutableTransactionSignatureCreator (MarcoFalke)

Pull request description:

  The `MutableTransactionSignatureCreator` constructor takes in a pointer to a mutable transaction. This is problematic for several reasons:

  * It would be undefined behaviour to pass in a nullptr because for signature creation, the memory of the mutable transaction is accessed
  * No caller currently passes in a nullptr, so passing a reference as a pointer is confusing

  Fix all issues by replacing `*` with `&` in `MutableTransactionSignatureCreator`

ACKs for top commit:
  theStack:
    Code-review ACK fac6cfc50f
  jonatack:
    ACK fac6cfc50f

Tree-SHA512: d84296b030bd4fa2709e5adbfe43a5f8377d218957d844af69a819893252af671df7f00004f5ba601a0bd70f3c1c2e58c4f00e75684da663f28432bb5c89fb86
2022-05-06 11:12:10 +02:00
MacroFake
b2e7811c62
Merge bitcoin/bitcoin#24538: miner: bug fix? update for ancestor inclusion using modified fees, not base
e4303c337c [unit test] prioritisation in mining (glozow)
7a8d60676b [miner] bug fix: update for parent inclusion using modified fee (glozow)
0f9a44461c 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 e4303c337c 🚗

Tree-SHA512: 4cd94106fbc9353e9f9b6d5af268ecda5aec7539245298c940ca220606dd0737264505bfaae1f83d94765cc2d9e1a6e913a765048fe6c19292482241761a6762
2022-05-06 11:06:13 +02:00