From aa75eebc22d4ba3d3b3bfcb3307ac1a527c7a9e4 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 10 Apr 2022 22:54:34 -0400 Subject: [PATCH] re-add `blockchain.scripthash.get_balance` fixes https://github.com/lbryio/scribe/issues/19 --- scribe/hub/session.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scribe/hub/session.py b/scribe/hub/session.py index ed246a1..e1c7094 100644 --- a/scribe/hub/session.py +++ b/scribe/hub/session.py @@ -827,6 +827,8 @@ class LBRYElectrumX(asyncio.Protocol): coro = self.scripthash_get_mempool elif method == 'blockchain.scripthash.subscribe': coro = self.scripthash_subscribe + elif method == 'blockchain.scripthash.get_balance': + coro = self.scripthash_get_balance elif method == 'blockchain.transaction.broadcast': coro = self.transaction_broadcast elif method == 'blockchain.transaction.get': @@ -1409,10 +1411,10 @@ class LBRYElectrumX(asyncio.Protocol): unconfirmed = self.mempool.balance_delta(hashX) return {'confirmed': confirmed, 'unconfirmed': unconfirmed} - # async def scripthash_get_balance(self, scripthash): - # """Return the confirmed and unconfirmed balance of a scripthash.""" - # hashX = scripthash_to_hashX(scripthash) - # return await self.get_balance(hashX) + async def scripthash_get_balance(self, scripthash): + """Return the confirmed and unconfirmed balance of a scripthash.""" + hashX = scripthash_to_hashX(scripthash) + return await self.get_balance(hashX) def unconfirmed_history(self, hashX): # Note unconfirmed history is unordered in electrum-server