Skip only the item that doesn't satisfy the inclusion filter (#13992)

This commit is contained in:
Amine Khaldi 2022-12-01 18:02:22 +01:00 committed by GitHub
parent a5fa4c2afe
commit db5efe18c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,11 +160,12 @@ class MempoolManager:
if broke_from_inner_loop:
break
for item in dic.values():
if not item_inclusion_filter(self, item):
continue
log.info(f"Cumulative cost: {cost_sum}, fee per cost: {item.fee / item.cost}")
if (
item.cost + cost_sum <= self.limit_factor * self.constants.MAX_BLOCK_COST_CLVM
and item.fee + fee_sum <= self.constants.MAX_COIN_AMOUNT
and item_inclusion_filter(self, item)
):
spend_bundles.append(item.spend_bundle)
cost_sum += item.cost