         print ("APP: CurrenciesToMode  : \(currencyCodesToMode)")
 
         // Create the listener
-        let listener = CoreDemoListener (networkCurrencyCodesToMode: currencyCodesToMode,
+        listener = CoreDemoListener (networkCurrencyCodesToMode: currencyCodesToMode,
                                          registerCurrencyCodes: registerCurrencyCodes,
                                          isMainnet: mainnet)
 
         // Create the BlockChainDB
-        let query = BlockChainDB.createForTest ()
+        query = BlockChainDB.createForTest ()
 
         // Create the system
-        self.listener = listener
         self.system = System (listener: listener,
                               account: account,
                               onMainnet: mainnet,

        
        print ("APP: Account PaperKey  : \(accountSpecification.paperKey.components(separatedBy: CharacterSet.whitespaces).first ?? "<missed>") ...")
        print ("APP: Account Timestamp : \(account.timestamp)")
        print ("APP: StoragePath       : \(storagePath)");
        print ("APP: Mainnet           : \(mainnet)")
        let currencyCodesToMode: [String:WalletManagerMode] = [
            "btc" : .api_only,

    var listener: CoreDemoListener!
    var system: System!
    var mainnet = true

    var accountSpecification: AccountSpecification!
    var account: Account!
    var storagePath: String!

    var query: BlockChainDB!

    var btcPeerSpec = (address: "103.99.168.100", port: UInt16(8333))
    var btcPeer: NetworkPeer? = nil
