[refactor] pass size/count instead of entry to CalculateAncestorsAndCheckLimits
This does not change existing behavior.
The ancestor/descendant limits are inclusive of the entries themselves,
but CalculateAncestorsAndCheckLimits() does not need access to them.
[mempool] check ancestor/descendant limits for packages
When calculating ancestor/descendant counts for transactions in the
package, as a heuristic, count every transaction in the package as an
ancestor and descendant of every other transaction in the package.
This may overestimate, but will not underestimate, the
ancestor/descendant counts. This shortcut still produces an accurate
count for packages of 1 parent + 1 child.
[policy] ancestor/descendant limits for packages
[test] helper function to increase transaction weight
Use our existing pad_tx function.
[test] parameterizable fee for make_chain and create_child_with_parents
[test] mempool package ancestor/descendant limits
- tx.rehash() replaced with tx.get_id()
- used helper functions ToHex and FromHex. tx_from_hex is not available due to missing backports.
- our limit for number of transactions in a package is 50. This leads to some minor logical differences in the tests, because where Core uses 24 transactions (an even number) we use 49 (an odd number). This leads to some asymetric chain transactions branches where the source material has symetric branches, and vice-versa.
This concludes backport of core#21800