ui: Fix missing coin from data.
This commit is contained in:
		
							parent
							
								
									85bbccf82a
								
							
						
					
					
						commit
						b179667cc5
					
				@ -500,7 +500,7 @@ class BasicSwap(BaseApp):
 | 
			
		||||
            authcookiepath = os.path.join(self.getChainDatadirPath(coin), '.cookie')
 | 
			
		||||
 | 
			
		||||
            pidfilename = cc['name']
 | 
			
		||||
            if cc['name'] == 'bitcoin' or cc['name'] == 'litecoin' or cc['name'] == 'namecoin':
 | 
			
		||||
            if cc['name'] in ('bitcoin', 'litecoin', 'namecoin'):
 | 
			
		||||
                pidfilename += 'd'
 | 
			
		||||
 | 
			
		||||
            pidfilepath = os.path.join(self.getChainDatadirPath(coin), pidfilename + '.pid')
 | 
			
		||||
@ -521,7 +521,10 @@ class BasicSwap(BaseApp):
 | 
			
		||||
                        datadir_pid = int(fp.read().decode('utf-8'))
 | 
			
		||||
                    assert (datadir_pid == cc['pid']), 'Mismatched pid'
 | 
			
		||||
                    assert (os.path.exists(authcookiepath))
 | 
			
		||||
                except Exception:
 | 
			
		||||
                    break
 | 
			
		||||
                except Exception as e:
 | 
			
		||||
                    if self.debug:
 | 
			
		||||
                        self.log.warning('Error, iteration %d: %s', i, str(e))
 | 
			
		||||
                    self.delay_event.wait(0.5)
 | 
			
		||||
            try:
 | 
			
		||||
                if os.name != 'nt' or cc['core_version_group'] > 17:  # Litecoin on windows doesn't write a pid file
 | 
			
		||||
 | 
			
		||||
@ -549,10 +549,13 @@ def page_offers(self, url_split, post_string, sent=False):
 | 
			
		||||
            o.was_sent,
 | 
			
		||||
            ci_from.format_amount(completed_amount)))
 | 
			
		||||
 | 
			
		||||
    coins_from, coins_to = listAvailableCoins(swap_client, split_from=True)
 | 
			
		||||
 | 
			
		||||
    template = server.env.get_template('offers.html')
 | 
			
		||||
    return self.render_template(template, {
 | 
			
		||||
        'messages': messages,
 | 
			
		||||
        'coins': listAvailableCoins(swap_client),
 | 
			
		||||
        'coins_from': coins_from,
 | 
			
		||||
        'coins': coins_to,
 | 
			
		||||
        'messages': messages,
 | 
			
		||||
        'filters': filters,
 | 
			
		||||
        'offers': formatted_offers,
 | 
			
		||||
 | 
			
		||||
@ -230,11 +230,11 @@ def prepare_swapclient_dir(datadir, node_id, network_key, network_pubkey, with_l
 | 
			
		||||
        json.dump(settings, fp, indent=4)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def btcRpc(cmd, node_id=0):
 | 
			
		||||
def btcCli(cmd, node_id=0):
 | 
			
		||||
    return callrpc_cli(cfg.BITCOIN_BINDIR, os.path.join(TEST_DIR, 'btc_' + str(node_id)), 'regtest', cmd, cfg.BITCOIN_CLI)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def ltcRpc(cmd, node_id=0):
 | 
			
		||||
def ltcCli(cmd, node_id=0):
 | 
			
		||||
    return callrpc_cli(cfg.LITECOIN_BINDIR, os.path.join(TEST_DIR, 'ltc_' + str(node_id)), 'regtest', cmd, cfg.LITECOIN_CLI)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -280,9 +280,9 @@ def run_coins_loop(cls):
 | 
			
		||||
        pause_event.wait()
 | 
			
		||||
        try:
 | 
			
		||||
            if cls.btc_addr is not None:
 | 
			
		||||
                btcRpc('generatetoaddress 1 {}'.format(cls.btc_addr))
 | 
			
		||||
                btcCli('generatetoaddress 1 {}'.format(cls.btc_addr))
 | 
			
		||||
            if cls.ltc_addr is not None:
 | 
			
		||||
                ltcRpc('generatetoaddress 1 {}'.format(cls.ltc_addr))
 | 
			
		||||
                ltcCli('generatetoaddress 1 {}'.format(cls.ltc_addr))
 | 
			
		||||
            if cls.xmr_addr is not None:
 | 
			
		||||
                callrpc_xmr_na(XMR_BASE_RPC_PORT + 1, 'generateblocks', {'wallet_address': cls.xmr_addr, 'amount_of_blocks': 1})
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user