Forked from termslang/gist:1b10ab43bf94733fc4102e0845dc48bb
Created
March 26, 2019 09:26
-
-
Save kevroletin/7875c1fbf3880ba9a9d8d6c8b9406358 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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