Alpha/Baker: only retain applied, delayed and unprocessed mempool operations

This commit is contained in:
Vincent Botbol 2018-06-30 04:37:08 +02:00 committed by Benjamin Canou
parent fbefa3940d
commit f59b0aa44f

View File

@ -264,11 +264,10 @@ let forge (op : Operation.packed) : Operation.raw =
}
let ops_of_mempool (ops : Alpha_block_services.Mempool.t) =
(* We only retain the applied, unprocessed and delayed operations *)
List.rev (
Operation_hash.Map.fold (fun _ op acc -> op :: acc) ops.unprocessed @@
Operation_hash.Map.fold (fun _ (op, _) acc -> op :: acc) ops.branch_delayed @@
Operation_hash.Map.fold (fun _ (op, _) acc -> op :: acc) ops.branch_refused @@
Operation_hash.Map.fold (fun _ (op, _) acc -> op :: acc) ops.refused @@
List.rev_map (fun (_, op) -> op) ops.applied
)