From e1407cd8d0aad20306b4607aaa59f089d8700a6f Mon Sep 17 00:00:00 2001 From: Cryp Toon Date: Mon, 16 Dec 2024 16:50:36 +0100 Subject: [PATCH] Fix for incorrect transaction order in mempool providers API --- README.rst | 4 ++-- bitcoinlib/services/mempool.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index fa9109c4..769f0992 100644 --- a/README.rst +++ b/README.rst @@ -88,8 +88,8 @@ If successful a transaction ID is returned >>> t.info # Shows transaction information and send results -More examples -------------- +More Examples and Use Cases +--------------------------- You can find many more examples in the `documentation `_ for instance about the `Wallet.create() `_ method. diff --git a/bitcoinlib/services/mempool.py b/bitcoinlib/services/mempool.py index 7a5af744..d664b422 100644 --- a/bitcoinlib/services/mempool.py +++ b/bitcoinlib/services/mempool.py @@ -141,7 +141,7 @@ def gettransactions(self, address, after_txid='', limit=MAX_TRANSACTIONS): if len(prtxs) > 100: break txs = [] - for tx in prtxs[::-1]: + for tx in sorted(prtxs, key=lambda x: x['status']['block_height']): t = self._parse_transaction(tx) if t: txs.append(t)