26
26
27
27
from chia .consensus .block_record import BlockRecordProtocol
28
28
from chia .consensus .check_time_locks import check_time_locks
29
- from chia .consensus .cost_calculator import NPCResult
30
29
from chia .full_node .bitcoin_fee_estimator import create_bitcoin_fee_estimator
31
30
from chia .full_node .fee_estimation import FeeBlockInfo , MempoolInfo , MempoolItemInfo
32
31
from chia .full_node .fee_estimator_interface import FeeEstimatorInterface
@@ -480,8 +479,6 @@ async def pre_validate_spendbundle(
480
479
if bls_cache is not None :
481
480
bls_cache .update (new_cache_entries )
482
481
483
- ret = NPCResult (None , sbc )
484
-
485
482
if spend_bundle_id is None :
486
483
spend_bundle_id = spend_bundle .name ()
487
484
@@ -490,10 +487,7 @@ async def pre_validate_spendbundle(
490
487
f"pre_validate_spendbundle took { duration :0.4f} seconds "
491
488
f"for { spend_bundle_id } (queue-size: { self ._worker_queue_size } )" ,
492
489
)
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
497
491
498
492
async def add_spend_bundle (
499
493
self ,
@@ -507,14 +501,16 @@ async def add_spend_bundle(
507
501
] = None ,
508
502
) -> SpendBundleAddInfo :
509
503
"""
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
513
509
added to the potential pool.
514
510
515
511
Args:
516
512
new_spend: spend bundle to validate and add
517
- conds: result of running the clvm transaction in a fake block
513
+ conds: SpendBundleConditions resulting from running the clvm in the spend bundle's coin spends
518
514
spend_name: hash of the spend bundle data, passed in as an optimization
519
515
520
516
Returns:
0 commit comments