1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 01:43:29 +01:00

Support latest Bitcoin Core in contrib/mempool.py

This commit is contained in:
Roman Zeyde 2022-03-12 16:18:53 +02:00
parent 2b1b0f2f04
commit 1b4cc1ec0f

View File

@ -21,7 +21,7 @@ def main():
txids = list(map(lambda a: [a], txids))
entries = d.request('getmempoolentry', txids)
entries = [{'fee': e['fee']*1e8, 'vsize': e['vsize']} for e in entries]
entries = [{'fee': e['fees']['base']*1e8, 'vsize': e['vsize']} for e in entries]
for e in entries:
e['rate'] = e['fee'] / e['vsize'] # sat/vbyte
entries.sort(key=lambda e: e['rate'], reverse=True)