| 451 | // All the intermediate state that gets passed between the various levels |
| 452 | // of checking a given transaction. |
| 453 | struct Workspace { |
| 454 | Workspace(const CTransactionRef &ptx, |
| 455 | const uint32_t next_block_script_verify_flags) |
| 456 | : m_ptx(ptx), |
| 457 | m_next_block_script_verify_flags(next_block_script_verify_flags) { |
| 458 | } |
| 459 | /** |
| 460 | * Mempool entry constructed for this transaction. |
| 461 | * Constructed in PreChecks() but not inserted into the mempool until |
| 462 | * Finalize(). |
| 463 | */ |
| 464 | std::unique_ptr<CTxMemPoolEntry> m_entry; |
| 465 | |
| 466 | /** |
| 467 | * Virtual size of the transaction as used by the mempool, calculated |
| 468 | * using serialized size of the transaction and sigchecks. |
| 469 | */ |
| 470 | int64_t m_vsize; |
| 471 | /** |
| 472 | * Fees paid by this transaction: total input amounts subtracted by |
| 473 | * total output amounts. |
| 474 | */ |
| 475 | Amount m_base_fees; |
| 476 | |
| 477 | /** |
| 478 | * Base fees + any fee delta set by the user with |
| 479 | * prioritisetransaction. |
| 480 | */ |
| 481 | Amount m_modified_fees; |
| 482 | |
| 483 | /** |
| 484 | * If we're doing package validation (i.e. m_package_feerates=true), the |
| 485 | * "effective" package feerate of this transaction is the total fees |
| 486 | * divided by the total size of transactions (which may include its |
| 487 | * ancestors and/or descendants). |
| 488 | */ |
| 489 | CFeeRate m_package_feerate{Amount::zero()}; |
| 490 | |
| 491 | const CTransactionRef &m_ptx; |
| 492 | TxValidationState m_state; |
| 493 | /** |
| 494 | * A temporary cache containing serialized transaction data for |
| 495 | * signature verification. |
| 496 | * Reused across PreChecks and ConsensusScriptChecks. |
| 497 | */ |
| 498 | PrecomputedTransactionData m_precomputed_txdata; |
| 499 | |
| 500 | // ABC specific flags that are used in both PreChecks and |
| 501 | // ConsensusScriptChecks |
| 502 | const uint32_t m_next_block_script_verify_flags; |
| 503 | int m_sig_checks_standard; |
| 504 | }; |
| 505 | |
| 506 | // Run the policy checks on a given transaction, excluding any script |
| 507 | // checks. Looks up inputs, calculates feerate, considers replacement, |
no outgoing calls
no test coverage detected