Page MenuHomePhabricator

Use mempool's descendent count in the wallet code
ClosedPublic

Authored by deadalnix on Jun 14 2019, 21:03.

Details

Summary
  • mempool: Add explicit max_descendants

TransactionWithinChainLimits would take a 'limit' and check it against ascendants and descendants. This is changed to take an explicit
max ancestors and max descendants value, and to test the corresponding value against its corresponding max.

  • mempool: Fix max descendants check

The chain limits check for max descendants would check the descendants of the transaction itself even though the description for -limitdescendantcount says 'any ancestor'. This commit corrects the descendant count check by finding the top parent transaction in the mempool and comparing against that.

  • mempool: Calculate descendant maximum thoroughly

This is a partial backport of Core PR12634

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Calculate descendant maximum thoroughly

deadalnix retitled this revision from Use mempool's descendent count int he wallet code to Use mempool's descendent count in the wallet code.
Fabien requested changes to this revision.Jun 17 2019, 07:07
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/txmempool.h
707 ↗(On Diff #9459)

Since the prototype is getting changed, it is the opportunity to update uint256 to TxId.
Not sure what's the best place to do so, this diff or D3343.

This revision now requires changes to proceed.Jun 17 2019, 07:07
deadalnix added inline comments.
src/txmempool.h
707 ↗(On Diff #9459)

I'm pretty sure this is not part of the backport.

Fabien added inline comments.
src/txmempool.h
707 ↗(On Diff #9459)

Sure it is not, can be done in a later diff.

This revision is now accepted and ready to land.Jun 17 2019, 17:00