@@ -1430,16 +1430,23 @@ async def peak_post_processing(
1430
1430
)
1431
1431
1432
1432
if fns_peak_result .new_signage_points is not None and peer is not None :
1433
- for index , sp in fns_peak_result .new_signage_points :
1434
- assert (
1435
- sp .cc_vdf is not None
1436
- and sp .cc_proof is not None
1437
- and sp .rc_vdf is not None
1438
- and sp .rc_proof is not None
1439
- )
1440
- await self .signage_point_post_processing (
1441
- RespondSignagePoint (index , sp .cc_vdf , sp .cc_proof , sp .rc_vdf , sp .rc_proof ), peer , sub_slots [1 ]
1442
- )
1433
+ # this is protecting the signage point store, to ensure we only
1434
+ # process one at a time and never add the same SP twice
1435
+ async with self .timelord_lock :
1436
+ for index , sp in fns_peak_result .new_signage_points :
1437
+ assert (
1438
+ sp .cc_vdf is not None
1439
+ and sp .cc_proof is not None
1440
+ and sp .rc_vdf is not None
1441
+ and sp .rc_proof is not None
1442
+ )
1443
+ sphash = sp .cc_vdf .output .get_hash ()
1444
+ if self .full_node_store .get_signage_point (sphash ) is not None :
1445
+ self .log .debug ("signage point already processed, skipping: %s" , sphash )
1446
+ continue
1447
+ await self .signage_point_post_processing (
1448
+ RespondSignagePoint (index , sp .cc_vdf , sp .cc_proof , sp .rc_vdf , sp .rc_proof ), peer , sub_slots [1 ]
1449
+ )
1443
1450
1444
1451
if sub_slots [1 ] is None :
1445
1452
assert record .ip_sub_slot_total_iters (self .constants ) == 0
0 commit comments