From 50a7340d154b41dc00d4d89d7e270335574bbe2c Mon Sep 17 00:00:00 2001 From: Yostra Date: Wed, 22 Jan 2020 17:27:31 -0800 Subject: [PATCH] mempool item --- src/mempool.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mempool.py b/src/mempool.py index aec580a6..8151e245 100644 --- a/src/mempool.py +++ b/src/mempool.py @@ -16,7 +16,7 @@ from src.unspent_store import UnspentStore from src.util.Conditions import ConditionOpcode, ConditionVarPair from src.util.ConsensusError import Err from src.util.consensus import conditions_dict_for_solution, hash_key_pairs_for_conditions_dict -from src.util.ints import uint32 +from src.util.ints import uint32, uint64 @dataclass(frozen=True) @@ -28,6 +28,16 @@ class Pool: conflicting: Dict[BundleHash: BundleHash] +@dataclass(frozen=True) +class MempoolItem: + spend_bundle: SpendBundle + fee_per_cost: uint64 + fee: uint64 + + def __lt__(self, other): + return self.fee_per_cost < other.fee_per_cost + + @dataclass(frozen=True) class NPC: coin_name: bytes32