URI: 
       tremove interface.synchronous_get - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit ed8f9666df292017be85b32794cb4e78e2bb0411
   DIR parent 087490a197004b4e5fd5ca823a628c18c15e44d6
  HTML Author: ThomasV <thomasv@gitorious>
       Date:   Tue, 29 Jul 2014 00:15:21 +0200
       
       remove interface.synchronous_get
       
       Diffstat:
         M lib/blockchain.py                   |      29 ++++++-----------------------
         M lib/interface.py                    |      15 ---------------
         M lib/network.py                      |       5 -----
       
       3 files changed, 6 insertions(+), 43 deletions(-)
       ---
   DIR diff --git a/lib/blockchain.py b/lib/blockchain.py
       t@@ -291,32 +291,16 @@ class Blockchain(threading.Thread):
                print_error("requesting header %d from %s"%(h, i.server))
                i.send_request({'method':'blockchain.block.get_header', 'params':[h]}, queue)
        
       -    def retrieve_header(self, i, queue):
       +    def retrieve_request(self, queue):
                while True:
                    try:
                        ir = queue.get(timeout=1)
                    except Queue.Empty:
       -                print_error('retrieve_header: timeout', i.server)
       +                print_error('blockchain: request timeout')
                        continue
       -
       -            if not ir: 
       -                continue
       -
                    i, r = ir
       -
       -            if r.get('error'):
       -                print_error('Verifier received an error:', r)
       -                continue
       -
       -            # 3. handle response
       -            method = r['method']
       -            params = r['params']
                    result = r['result']
       -
       -            if method == 'blockchain.block.get_header':
       -                return result
       -                
       -
       +            return result
        
            def get_chain(self, interface, final_header):
        
       t@@ -328,7 +312,7 @@ class Blockchain(threading.Thread):
                while self.is_running():
        
                    if requested_header:
       -                header = self.retrieve_header(interface, queue)
       +                header = self.retrieve_request(queue)
                        if not header: return
                        chain = [ header ] + chain
                        requested_header = False
       t@@ -361,9 +345,8 @@ class Blockchain(threading.Thread):
                n = min_index
                while n < max_index + 1:
                    print_error( "Requesting chunk:", n )
       -            r = i.synchronous_get([ ('blockchain.block.get_chunk',[n])])[0]
       -            if not r: 
       -                continue
       +            i.send_request({'method':'blockchain.block.get_chunk', 'params':[n]}, queue)
       +            r = self.retrieve_request(queue)
                    try:
                        self.verify_chunk(n, r)
                        n = n + 1
   DIR diff --git a/lib/interface.py b/lib/interface.py
       t@@ -341,21 +341,6 @@ class Interface(threading.Thread):
                # print_error( "change status", self.server, self.is_connected)
                self.response_queue.put((self, None))
        
       -    def synchronous_get(self, requests, timeout=100000000):
       -        queue = Queue.Queue()
       -        ids = self.send(requests, lambda i,r: queue.put(r))
       -        id2 = ids[:]
       -        res = {}
       -        while ids:
       -            r = queue.get(True, timeout)
       -            _id = r.get('id')
       -            if _id in ids:
       -                ids.remove(_id)
       -                res[_id] = r.get('result')
       -        out = []
       -        for _id in id2:
       -            out.append(res[_id])
       -        return out
        
        
        class HTTP_Interface(Interface):
   DIR diff --git a/lib/network.py b/lib/network.py
       t@@ -447,11 +447,6 @@ class Network(threading.Thread):
                with self.lock:
                    return self.running
        
       -    
       -    def synchronous_get(self, requests, timeout=100000000):
       -        return self.interface.synchronous_get(requests)
       -
       -
            def get_header(self, tx_height):
                return self.blockchain.read_header(tx_height)