Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions chia/full_node/mempool_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

from chia.consensus.block_record import BlockRecordProtocol
from chia.consensus.check_time_locks import check_time_locks
from chia.consensus.cost_calculator import NPCResult
from chia.full_node.bitcoin_fee_estimator import create_bitcoin_fee_estimator
from chia.full_node.fee_estimation import FeeBlockInfo, MempoolInfo, MempoolItemInfo
from chia.full_node.fee_estimator_interface import FeeEstimatorInterface
Expand Down Expand Up @@ -480,8 +479,6 @@ async def pre_validate_spendbundle(
if bls_cache is not None:
bls_cache.update(new_cache_entries)

ret = NPCResult(None, sbc)

if spend_bundle_id is None:
spend_bundle_id = spend_bundle.name()

Expand All @@ -490,10 +487,7 @@ async def pre_validate_spendbundle(
f"pre_validate_spendbundle took {duration:0.4f} seconds "
f"for {spend_bundle_id} (queue-size: {self._worker_queue_size})",
)
if ret.error is not None:
raise ValidationError(Err(ret.error), "pre_validate_spendbundle failed")
assert ret.conds is not None
return ret.conds
return sbc

async def add_spend_bundle(
self,
Expand All @@ -507,14 +501,16 @@ async def add_spend_bundle(
] = None,
) -> SpendBundleAddInfo:
"""
Validates and adds to mempool a new_spend with the given NPCResult, and spend_name, and the current mempool.
The mempool should be locked during this call (blockchain lock). If there are mempool conflicts, the conflicting
spends might be removed (if the new spend is a superset of the previous). Otherwise, the new spend might be
Validates and adds to mempool a new_spend with the given
SpendBundleConditions, and spend_name, and the current mempool. The mempool
should be locked during this call (blockchain lock). If there are mempool
conflicts, the conflicting spends might be removed (if the new spend is
a superset of the previous). Otherwise, the new spend might be
added to the potential pool.

Args:
new_spend: spend bundle to validate and add
conds: result of running the clvm transaction in a fake block
conds: SpendBundleConditions resulting from running the clvm in the spend bundle's coin spends
spend_name: hash of the spend bundle data, passed in as an optimization

Returns:
Expand Down
2 changes: 1 addition & 1 deletion chia/types/internal_mempool_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ class InternalMempoolItem:
spend_bundle: SpendBundle
conds: SpendBundleConditions
height_added_to_mempool: uint32
# Map of coin ID to coin spend data between the bundle and its NPCResult
# Map of coin ID to coin spend data between the bundle and its SpendBundleConditions
bundle_coin_spends: dict[bytes32, BundleCoinSpend]
Loading