This is a follow-up PR to #17435, testing the custom descendant limit, passed by the argument -limitdescendantcount
. It was more tricky than expected, mainly because we don’t know for sure at which point node1 has got all the transactions broadcasted from node0 (for the ancestor test this wasn’t a problem since the txs were immediately available through invalidateblock
) – a simple sync_mempools()
doesn’t work here since the mempool contents are not equal due to different ancestor/descendant limits. Hence I came up with a “hacky manual sync”:
wait until the mempool has the expected tx count (see conditions below)after that, wait some time and get sure that the mempool contents haven’t changed in-between
Like for Similar to the ancestor test, we overall check for three four conditions:
- the # of txs in the node1 mempool is equal to the descendant limit (plus 1 for the parent tx, plus the # txs from the previous ancestor test which are still in)
(done by the hacky sync above) - all txs in node1 mempool are a subset of txs in node0 mempool
- part of the constructed descendant-chain (the first ones up to the limit) are contained in node1 mempool
- the remaining part of the constructed descendant-chain (all after the first ones up to the limit) is not contained in node1 mempool