Bitcoin node has 2 rules that limit the use of CPFP:
- number of descendants (including transaction itself) can't be more than 25
- total size of transaction and all its descendants can't be more than 100 000 vbytes
However, with CPFP carve out rule previously mentioned numbers can be exceeded. CPFP carve out says that one additional transaction up to 1000 vbytes can "added" to unconfirmed transaction (that does not have unconfirmed ancestors) even thought it will exceed 25 number of descendants and 100 000 vbytes limit.
I am interested in how is CPFP carve out rule checked? In other words, how does a Bitcoin node prevent a given rule from being used twice or more?
For example, assume a transaction with 3 outputs where one of them already made 25 descendant count and 100 000 vbytes. If we add a new transaction (200 vbytes) directly to one of two remaining outputs, what prevents us from adding another transaction (size up to 800 bytes) to that remaining third output?
Is there maybe some indicator for CPFP carve out which say whether it is used or not (although I'm not sure how it could be implemented since you can't know when CPFC carve out happens)? Does the given rule can be activated only when the transaction has exactly 2 outputs since then the CPFP carve out rule cannot be used on more than one outputs? Or is a third way used?