Skip to content

Commit

Permalink
Fix getaddressbalance.
Browse files Browse the repository at this point in the history
Note that point[0] has changed. Review this.
  • Loading branch information
parazyd committed Mar 22, 2021
1 parent 72bfdce commit efd6b26
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions electrum/zeromq.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,7 @@ async def broadcast_transaction(self, rawtx):
async def history4(self, scripthash, height=0):
__("Zeromq Client: history4")
command = b'blockchain.fetch_history4'
# libbitcoin expects this in reverse?, hence [::-1].
decoded_address = unhexlify(scripthash)[::-1]
decoded_address = unhexlify(scripthash)
error_code, raw_points = await self._simple_request(
command, decoded_address + struct.pack('<I', height))
if error_code:
Expand Down Expand Up @@ -475,7 +474,7 @@ def __correlate(points):
@staticmethod
def __correlate_spends_to_receives(points, transfers, checksum_to_index):
for point in points:
if point[0] == 0: # receive
if point[0] == 1: # receive
continue

spent = {
Expand All @@ -496,7 +495,7 @@ def __find_receives(points):
checksum_to_index = {}

for point in points:
if point[0] == 1: # spent
if point[0] == 0: # spent
continue

transfers.append({
Expand Down

0 comments on commit efd6b26

Please sign in to comment.