X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=backends%2Fabe%2F__init__.py;h=fe6fb80b30092047caf7608a4e92ec24ca230482;hp=9fd53cbfbb67fc7d4dcd2e20c84fe51cb1184273;hb=6504ac96768449288ac347c62005d6a911d93f69;hpb=9ef61e849b689da9c90ddfcee796a370fd1d12eb diff --git a/backends/abe/__init__.py b/backends/abe/__init__.py index 9fd53cb..fe6fb80 100644 --- a/backends/abe/__init__.py +++ b/backends/abe/__init__.py @@ -16,7 +16,7 @@ from processor import Processor, print_log from utils import * -class AbeStore(Datastore.Datastore): +class AbeStore(DataStore.DataStore): def __init__(self, config): conf = DataStore.CONFIG_DEFAULTS @@ -39,7 +39,7 @@ class AbeStore(Datastore.Datastore): print_log(' addrtype = 48') self.addrtype = 48 - Datastore.Datastore.__init__(self, args) + DataStore.DataStore.__init__(self, args) # Use 1 (Bitcoin) if chain_id is not sent self.chain_id = self.datadirs[0]["chain_id"] or 1 @@ -290,7 +290,7 @@ class AbeStore(Datastore.Datastore): "index": int(pos), "value": int(value), }) - known_tx.append(self.hashout_hex(tx_hash)) + known_tx.append(tx_hash) # todo: sort them really... txpoints = sorted(txpoints, key=operator.itemgetter("timestamp")) @@ -517,8 +517,8 @@ class AbeStore(Datastore.Datastore): # find subset. # TODO: do not compute this on client request, better store the hash tree of each block in a database... - merkle = map(decode, merkle) - target_hash = decode(tx_hash) + merkle = map(hash_decode, merkle) + target_hash = hash_decode(tx_hash) s = [] while len(merkle) != 1: @@ -528,10 +528,10 @@ class AbeStore(Datastore.Datastore): while merkle: new_hash = Hash(merkle[0] + merkle[1]) if merkle[0] == target_hash: - s.append(encode(merkle[1])) + s.append(hash_encode(merkle[1])) target_hash = new_hash elif merkle[1] == target_hash: - s.append(encode(merkle[0])) + s.append(hash_encode(merkle[0])) target_hash = new_hash n.append(new_hash) merkle = merkle[2:]