Skip to content

Commit baa0aec

Browse files
committed
remove unnecessary NPCResult in mempool_manager
1 parent 9a47aa2 commit baa0aec

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

chia/full_node/mempool_manager.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
from chia.consensus.block_record import BlockRecordProtocol
2828
from chia.consensus.check_time_locks import check_time_locks
29-
from chia.consensus.cost_calculator import NPCResult
3029
from chia.full_node.bitcoin_fee_estimator import create_bitcoin_fee_estimator
3130
from chia.full_node.fee_estimation import FeeBlockInfo, MempoolInfo, MempoolItemInfo
3231
from chia.full_node.fee_estimator_interface import FeeEstimatorInterface
@@ -480,8 +479,6 @@ async def pre_validate_spendbundle(
480479
if bls_cache is not None:
481480
bls_cache.update(new_cache_entries)
482481

483-
ret = NPCResult(None, sbc)
484-
485482
if spend_bundle_id is None:
486483
spend_bundle_id = spend_bundle.name()
487484

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

498492
async def add_spend_bundle(
499493
self,
@@ -507,9 +501,11 @@ async def add_spend_bundle(
507501
] = None,
508502
) -> SpendBundleAddInfo:
509503
"""
510-
Validates and adds to mempool a new_spend with the given NPCResult, and spend_name, and the current mempool.
511-
The mempool should be locked during this call (blockchain lock). If there are mempool conflicts, the conflicting
512-
spends might be removed (if the new spend is a superset of the previous). Otherwise, the new spend might be
504+
Validates and adds to mempool a new_spend with the given
505+
SpendBundleConditions, and spend_name, and the current mempool. The mempool
506+
should be locked during this call (blockchain lock). If there are mempool
507+
conflicts, the conflicting spends might be removed (if the new spend is
508+
a superset of the previous). Otherwise, the new spend might be
513509
added to the potential pool.
514510
515511
Args:

chia/types/internal_mempool_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ class InternalMempoolItem:
1414
spend_bundle: SpendBundle
1515
conds: SpendBundleConditions
1616
height_added_to_mempool: uint32
17-
# Map of coin ID to coin spend data between the bundle and its NPCResult
17+
# Map of coin ID to coin spend data between the bundle and its SpendBundleConditions
1818
bundle_coin_spends: dict[bytes32, BundleCoinSpend]

0 commit comments

Comments
 (0)