Shell: fix (part of) the memory leak in validator
This commit is contained in:
parent
ec12edeb91
commit
ab4015b189
@ -299,6 +299,9 @@ module Context_db = struct
|
|||||||
block.operations >>= fun () ->
|
block.operations >>= fun () ->
|
||||||
return (Ok block, false)
|
return (Ok block, false)
|
||||||
| Some block ->
|
| Some block ->
|
||||||
|
Lwt_list.iter_p (fun hash ->
|
||||||
|
Distributed_db.Operation.commit net_db hash)
|
||||||
|
block.operations >>= fun () ->
|
||||||
return (Ok block, true)
|
return (Ok block, true)
|
||||||
end
|
end
|
||||||
| Error err ->
|
| Error err ->
|
||||||
@ -388,9 +391,10 @@ module Context_db = struct
|
|||||||
min_block block acc
|
min_block block acc
|
||||||
else begin
|
else begin
|
||||||
Block_hash.Table.replace session.tbl hash { data with state = `Running begin
|
Block_hash.Table.replace session.tbl hash { data with state = `Running begin
|
||||||
process data.validator ~get_context ~set_context hash block >>= fun res ->
|
Lwt_main.yield () >>= fun () ->
|
||||||
Block_hash.Table.remove session.tbl hash ;
|
process data.validator ~get_context ~set_context hash block >>= fun res ->
|
||||||
Lwt.return res
|
Block_hash.Table.remove session.tbl hash ;
|
||||||
|
Lwt.return res
|
||||||
end } ;
|
end } ;
|
||||||
acc
|
acc
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user