Revert "de dupe hash key pairs"

This reverts commit e012f5b618.
This commit is contained in:
Yostra
2020-06-01 08:56:59 -07:00
committed by wjblanke
parent d1a0b54077
commit f752e7675c
2 changed files with 10 additions and 9 deletions
+3 -3
View File
@@ -839,7 +839,7 @@ class Blockchain:
return Err.WRONG_PUZZLE_HASH
# Verify conditions, create hash_key list for aggsig check
hash_key_pairs = set()
hash_key_pairs = []
for npc in npc_list:
unspent = removal_coin_records[npc.coin_name]
error = blockchain_check_conditions_dict(
@@ -847,7 +847,7 @@ class Blockchain:
)
if error:
return error
hash_key_pairs.update(
hash_key_pairs.extend(
hash_key_pairs_for_conditions_dict(npc.condition_dict, npc.coin_name)
)
@@ -855,7 +855,7 @@ class Blockchain:
# TODO: move this to pre_validate_blocks_multiprocessing so we can sync faster
if not block.header.data.aggregated_signature:
return Err.BAD_AGGREGATE_SIGNATURE
if not block.header.data.aggregated_signature.validate(list(hash_key_pairs)):
if not block.header.data.aggregated_signature.validate(hash_key_pairs):
return Err.BAD_AGGREGATE_SIGNATURE
return None
+7 -6
View File
@@ -276,7 +276,7 @@ class MempoolManager:
continue
# Verify conditions, create hash_key list for aggsig check
hash_key_pairs = set()
hash_key_pairs = []
error: Optional[Err] = None
for npc in npc_list:
coin_record: CoinRecord = removal_record_dict[npc.coin_name]
@@ -301,17 +301,18 @@ class MempoolManager:
added_to_potential = True
potential_error = error
break
more_pairs = hash_key_pairs_for_conditions_dict(
npc.condition_dict, npc.coin_name
)
hash_key_pairs.update(more_pairs)
hash_key_pairs.extend(
hash_key_pairs_for_conditions_dict(
npc.condition_dict, npc.coin_name
)
)
if error:
errors.append(error)
continue
# Verify aggregated signature
if not new_spend.aggregated_signature.validate(list(hash_key_pairs)):
if not new_spend.aggregated_signature.validate(hash_key_pairs):
return None, MempoolInclusionStatus.FAILED, Err.BAD_AGGREGATE_SIGNATURE
# Remove all conflicting Coins and SpendBundles