Skip to content

Commit

Permalink
Simplify Mempool's items_by_feerate.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmineKhaldi committed Jul 19, 2024
1 parent 444bec6 commit 7745764
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions chia/full_node/mempool.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,9 @@ def items_with_puzzle_hashes(self, puzzle_hashes: Set[bytes32], include_hints: b
# TODO: move "process_mempool_items()" into this class in order to do this a
# bit more efficiently
def items_by_feerate(self) -> Iterator[MempoolItem]:
with self._db_conn:
cursor = self._db_conn.execute("SELECT * FROM tx ORDER BY fee_per_cost DESC, seq ASC")
for row in cursor:
yield self._row_to_item(row)
cursor = self._db_conn.execute("SELECT * FROM tx ORDER BY fee_per_cost DESC, seq ASC")
for row in cursor:
yield self._row_to_item(row)

def size(self) -> int:
with self._db_conn:
Expand Down

0 comments on commit 7745764

Please sign in to comment.