move code that is specific to abe
[electrum-server.git] / backends / abe / __init__.py
index 7584fd5..61ecf44 100644 (file)
@@ -282,14 +282,13 @@ class AbeStore(Datastore_class):
             if tx_hash in known_tx:
                 continue
 
-            # this means that pending transactions were added to the db, even if they are not returned by getmemorypool
-            address_has_mempool = True
-
             # discard transactions that are too old
             if self.last_tx_id - tx_id > 10000:
                 print "discarding tx id", tx_id
                 continue
 
+            # this means that pending transactions were added to the db, even if they are not returned by getmemorypool
+            address_has_mempool = True
 
             #print "mempool", tx_hash
             txpoint = {
@@ -439,6 +438,11 @@ class BlockchainProcessor(Processor):
         self.store = AbeStore(config)
         self.block_number = -1
         self.watched_addresses = []
+
+        # catch_up first
+        n = self.store.main_iteration()
+        print "blockchain: %d blocks"%n
+
         threading.Timer(10, self.run_store_iteration).start()
 
     def process(self, request):