mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-13 11:35:20 +01:00
Rename CheckValidEphemeralTx to PreCheckEphemeralTx
This commit is contained in:
parent
cbf1a47d60
commit
04a614bf9a
3 changed files with 5 additions and 5 deletions
|
@ -10,7 +10,7 @@ bool HasDust(const CTransactionRef& tx, CFeeRate dust_relay_rate)
|
|||
return std::any_of(tx->vout.cbegin(), tx->vout.cend(), [&](const auto& output) { return IsDust(output, dust_relay_rate); });
|
||||
}
|
||||
|
||||
bool CheckValidEphemeralTx(const CTransactionRef& tx, CFeeRate dust_relay_rate, CAmount base_fee, CAmount mod_fee, TxValidationState& state)
|
||||
bool PreCheckEphemeralTx(const CTransactionRef& tx, CFeeRate dust_relay_rate, CAmount base_fee, CAmount mod_fee, TxValidationState& state)
|
||||
{
|
||||
// We never want to give incentives to mine this transaction alone
|
||||
if ((base_fee != 0 || mod_fee != 0) && HasDust(tx, dust_relay_rate)) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* set.
|
||||
|
||||
* This is ensured by requiring:
|
||||
* - CheckValidEphemeralTx checks are respected
|
||||
* - PreCheckEphemeralTx checks are respected
|
||||
* - The parent has no child (and 0-fee as implied above to disincentivize mining)
|
||||
* - OR the parent transaction has exactly one child, and the dust is spent by that child
|
||||
*
|
||||
|
@ -43,7 +43,7 @@ bool HasDust(const CTransactionRef& tx, CFeeRate dust_relay_rate);
|
|||
* Does context-less checks about a single transaction.
|
||||
* Returns false if the fee is non-zero and dust exists, populating state. True otherwise.
|
||||
*/
|
||||
bool CheckValidEphemeralTx(const CTransactionRef& tx, CFeeRate dust_relay_rate, CAmount base_fee, CAmount mod_fee, TxValidationState& state);
|
||||
bool PreCheckEphemeralTx(const CTransactionRef& tx, CFeeRate dust_relay_rate, CAmount base_fee, CAmount mod_fee, TxValidationState& state);
|
||||
|
||||
/** Must be called for each transaction(package) if any dust is in the package.
|
||||
* Checks that each transaction's parents have their dust spent by the child,
|
||||
|
|
|
@ -915,8 +915,8 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
|||
|
||||
// Enforces 0-fee for dust transactions, no incentive to be mined alone
|
||||
if (m_pool.m_opts.require_standard) {
|
||||
if (!CheckValidEphemeralTx(ptx, m_pool.m_opts.dust_relay_feerate, ws.m_base_fees, ws.m_modified_fees, state)) {
|
||||
return false; // state filled in by CheckValidEphemeralTx
|
||||
if (!PreCheckEphemeralTx(ptx, m_pool.m_opts.dust_relay_feerate, ws.m_base_fees, ws.m_modified_fees, state)) {
|
||||
return false; // state filled in by PreCheckEphemeralTx
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue