mirror of https://github.com/status-im/nim-eth.git
release the memory a bit sooner
This commit is contained in:
parent
dcb82f6a96
commit
7954c0c7ed
|
@ -55,8 +55,9 @@ proc availableWorkItem(ctx: SyncContext): int =
|
||||||
else:
|
else:
|
||||||
discard
|
discard
|
||||||
|
|
||||||
let eb = ctx.workQueue[i].endIndex
|
let endBlock = ctx.workQueue[i].endIndex
|
||||||
if eb > maxPendingBlock: maxPendingBlock = eb
|
if endBlock > maxPendingBlock:
|
||||||
|
maxPendingBlock = endBlock
|
||||||
|
|
||||||
let nextRequestedBlock = maxPendingBlock + 1
|
let nextRequestedBlock = maxPendingBlock + 1
|
||||||
if nextRequestedBlock >= ctx.endBlockNumber:
|
if nextRequestedBlock >= ctx.endBlockNumber:
|
||||||
|
@ -79,8 +80,8 @@ proc persistWorkItem(ctx: SyncContext, wi: var WantedBlocks) =
|
||||||
of ValidationResult.Error:
|
of ValidationResult.Error:
|
||||||
wi.state = Initial
|
wi.state = Initial
|
||||||
# successful or not, we're done with these blocks
|
# successful or not, we're done with these blocks
|
||||||
wi.headers.setLen(0)
|
wi.headers = @[]
|
||||||
wi.bodies.setLen(0)
|
wi.bodies = @[]
|
||||||
|
|
||||||
proc persistPendingWorkItems(ctx: SyncContext) =
|
proc persistPendingWorkItems(ctx: SyncContext) =
|
||||||
var nextStartIndex = ctx.finalizedBlock + 1
|
var nextStartIndex = ctx.finalizedBlock + 1
|
||||||
|
|
Loading…
Reference in New Issue