Must be called for every transaction that is submitted within a package, even if not TRUC.
Synopsis
Declared in <policy/truc_policy.h>
[[requires_capability(0x7f2e281b9650)]]
std::optional<std::string>
PackageTRUCChecks(
CTxMemPool const& pool,
CTransactionRef const& ptx,
int64_t vsize,
Package const& package,
std::vector<CTxMemPoolEntry::CTxMemPoolEntryRef> const& mempool_parents);
Description
For each transaction in a package: If it's not a TRUC transaction, verify it has no direct TRUC parents in the mempool or the package.
If it is a TRUC transaction, verify that any direct parents in the mempool or the package are TRUC. If such a parent exists, verify that parent has no other children in the package or the mempool, and that the transaction itself has no children in the package.
If any TRUC violations in the package exist, this test will fail for one of them:
-
if a TRUC transaction T has a parent in the mempool and a child in the package, then PTRUCC(T) will fail
-
if a TRUC transaction T has a parent in the package and a child in the package, then PTRUCC(T) will fail
-
if a TRUC transaction T and a TRUC (sibling) transaction U have some parent in the mempool, then PTRUCC(T) and PTRUCC(U) will fail
-
if a TRUC transaction T and a TRUC (sibling) transaction U have some parent in the package, then PTRUCC(T) and PTRUCC(U) will fail
-
if a TRUC transaction T has a parent P and a grandparent G in the package, then PTRUCC(P) will fail (though PTRUCC(G) and PTRUCC(T) might succeed).
Return Value
debug string if an error occurs, std::nullopt otherwise.
Parameters
Name |
Description |
pool [in] |
A reference to the mempool. |
ptx [in] |
The transaction being checked. |
vsize [in] |
The sigop‐adjusted virtual size of ptx. |
package [in] |
The package that ptx belongs to. |
mempool_parents [in] |
The in‐mempool ancestors of ptx. |
Created with MrDocs