From d8bb174f2b85286cd5418b0b2e8163dcf91f9e4f Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 12 Nov 2016 09:34:53 +0900 Subject: [PATCH 1/2] Use correct daemon API --- server/daemon.py | 4 ++++ server/protocol.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/daemon.py b/server/daemon.py index 1dae4cd..a5e006e 100644 --- a/server/daemon.py +++ b/server/daemon.py @@ -128,6 +128,10 @@ class Daemon(util.LoggedClass): params_iterable = ((h, ) for h in range(first, first + count)) return await self._send_vector('getblockhash', params_iterable) + async def deserialised_block(self, hex_hash): + '''Return the deserialised block with the given hex hash.''' + return await self._send_single('getblock', (hex_hash, True)) + async def raw_blocks(self, hex_hashes): '''Return the raw binary blocks with the given hex hashes.''' params_iterable = ((h, False) for h in hex_hashes) diff --git a/server/protocol.py b/server/protocol.py index 477ae86..2d9946e 100644 --- a/server/protocol.py +++ b/server/protocol.py @@ -382,8 +382,8 @@ class ElectrumX(JSONRPC): @classmethod async def tx_merkle(cls, tx_hash, height): '''tx_hash is a hex string.''' - block_hash = await cls.DAEMON.send_single('getblockhash', (height,)) - block = await cls.DAEMON.send_single('getblock', (block_hash, True)) + hex_hashes = await cls.DAEMON.block_hex_hashes(height, 1) + block = await cls.DAEMON.deserialised_block(hex_hashes[0]) tx_hashes = block['tx'] # This will throw if the tx_hash is bad pos = tx_hashes.index(tx_hash) From 261682439dee2702f4bf73bb9295372a516b75c0 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 12 Nov 2016 09:46:20 +0900 Subject: [PATCH 2/2] Prepare 0.3.3 --- docs/RELEASE-NOTES | 6 +++--- server/version.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/RELEASE-NOTES b/docs/RELEASE-NOTES index 5d5139d..92748c8 100644 --- a/docs/RELEASE-NOTES +++ b/docs/RELEASE-NOTES @@ -1,7 +1,7 @@ -Version 0.3.2 -------------- +Version 0.3.2, 0.3.3 +-------------------- -- fixed silly bug in 0.3.1 +- fixed silly bugs Version 0.3.1 ------------- diff --git a/server/version.py b/server/version.py index 44f15ac..a05ff67 100644 --- a/server/version.py +++ b/server/version.py @@ -1 +1 @@ -VERSION = "ElectrumX 0.3.2" +VERSION = "ElectrumX 0.3.3"