Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevroletin/7875c1fbf3880ba9a9d8d6c8b9406358 to your computer and use it in GitHub Desktop.
Save kevroletin/7875c1fbf3880ba9a9d8d6c8b9406358 to your computer and use it in GitHub Desktop.
module Pool = struct
module TxSet = Set.Make (KEY)
let data = ref TxSet.empty
let add ~tx =
match is_valid ~tx with
| false -> ()
| true -> data := TxSet.add tx !data
let remove ~tx = data := TxSet.remove tx !data
let mem ~tx = TxSet.mem tx !data
let elements = TxSet.elements !data
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment