Fix error (chain_id == None) on some Abe installation
[electrum-server.git] / backends / abe / __init__.py
index d7c6013..a91402c 100644 (file)
@@ -35,7 +35,8 @@ class AbeStore(Datastore_class):
 
         Datastore_class.__init__(self,args)
 
-        self.chain_id = self.datadirs[0]["chain_id"];
+        # Use 1 (Bitcoin) if chain_id is not sent
+        self.chain_id = self.datadirs[0]["chain_id"] or 1
         print 'Coin chain_id = %d' % self.chain_id
 
         self.sql_limit = int( config.get('database','limit') )
@@ -424,7 +425,7 @@ class AbeStore(Datastore_class):
         with store.dblock:
             store.catch_up()
             store.memorypool_update()
-            block_number = store.get_block_number(self.chain_id)
+            block_number = store.get_block_number(store.chain_id)
             return block_number