Skip to content

Commit

Permalink
Fix beacon_sync mapBodiesToHeader bug (#2355)
Browse files Browse the repository at this point in the history
  • Loading branch information
jangko committed Jun 14, 2024
1 parent 0f53d11 commit 5784945
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nimbus/sync/beacon/beacon_impl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ proc mapBodiesToHeader(buddy: BeaconBuddyRef,
job: BeaconJob,
bodies: openArray[BlockBody],
reqBodies: openArray[bool]) {.raises: [].} =
doAssert(job.mode == bjmGetBlocks or
job.mode == bjmGetBodies,
"mapBodiesToHeader doesn't allow this job: " & $job.mode)
var
headers = system.move(job.getBlocksJob.headers)
headers = if job.mode == bjmGetBlocks:
system.move(job.getBlocksJob.headers)
else:
system.move(job.getBodiesJob.headers)
map = Table[Hash256, int]()

for i, x in bodies:
Expand Down

0 comments on commit 5784945

Please sign in to comment.