mirror of
https://github.com/basicswap/basicswap.git
synced 2024-12-23 03:49:25 +00:00
Add namecoin chainparams.
This commit is contained in:
parent
c51e28103e
commit
dd692fe5ef
2 changed files with 43 additions and 7 deletions
|
@ -496,9 +496,8 @@ class BasicSwap():
|
|||
|
||||
# Defaults
|
||||
self.coin_clients = {}
|
||||
self.coin_clients[Coins.PART] = self.setDefaultConnectParams(Coins.PART)
|
||||
self.coin_clients[Coins.BTC] = self.setDefaultConnectParams(Coins.BTC)
|
||||
self.coin_clients[Coins.LTC] = self.setDefaultConnectParams(Coins.LTC)
|
||||
for c in Coins:
|
||||
self.coin_clients[c] = self.setDefaultConnectParams(c)
|
||||
|
||||
if self.chain == 'regtest':
|
||||
SMSG_SECONDS_IN_DAY = 600
|
||||
|
@ -557,9 +556,10 @@ class BasicSwap():
|
|||
elif 'rpcpassword' in chain_client_settings:
|
||||
rpcauth = chain_client_settings['rpcuser'] + ':' + chain_client_settings['rpcpassword']
|
||||
if rpcauth is None:
|
||||
testnet_name = '' if self.chain == 'mainnet' else self.chain
|
||||
if testnet_name == 'testnet' and coin != Coins.PART:
|
||||
testnet_name += '4'
|
||||
if self.chain == 'mainnet':
|
||||
testnet_name = ''
|
||||
else:
|
||||
testnet_name = chainparams[coin][self.chain].get('name', self.chain)
|
||||
authcookiepath = os.path.join(datadir, testnet_name, '.cookie')
|
||||
# Wait for daemon to start
|
||||
for i in range(10):
|
||||
|
@ -891,7 +891,7 @@ class BasicSwap():
|
|||
if override_feerate:
|
||||
return override_feerate
|
||||
try:
|
||||
return self.callcoinrpc(coin_type, 'estimatesmartfee', [1])['feerate']
|
||||
return self.callcoinrpc(coin_type, 'estimatesmartfee', [2])['feerate']
|
||||
except Exception:
|
||||
try:
|
||||
fee_rate = self.callcoinrpc(coin_type, 'getwalletinfo')['paytxfee']
|
||||
|
|
|
@ -15,6 +15,7 @@ class Coins(IntEnum):
|
|||
BTC = 2
|
||||
LTC = 3
|
||||
# DCR = 4
|
||||
NMC = 5
|
||||
|
||||
|
||||
chainparams = {
|
||||
|
@ -74,6 +75,7 @@ chainparams = {
|
|||
'bip44': 1,
|
||||
'min_amount': 1000,
|
||||
'max_amount': 100000 * COIN,
|
||||
'name': 'testnet4',
|
||||
},
|
||||
'regtest': {
|
||||
'rpcport': 18443,
|
||||
|
@ -106,6 +108,7 @@ chainparams = {
|
|||
'bip44': 1,
|
||||
'min_amount': 1000,
|
||||
'max_amount': 100000 * COIN,
|
||||
'name': 'testnet4',
|
||||
},
|
||||
'regtest': {
|
||||
'rpcport': 19443,
|
||||
|
@ -116,5 +119,38 @@ chainparams = {
|
|||
'min_amount': 1000,
|
||||
'max_amount': 100000 * COIN,
|
||||
}
|
||||
},
|
||||
Coins.NMC: {
|
||||
'name': 'namecoin',
|
||||
'ticker': 'NMC',
|
||||
'message_magic': 'Namecoin Signed Message:\n',
|
||||
'mainnet': {
|
||||
'rpcport': 8336,
|
||||
'pubkey_address': 52,
|
||||
'script_address': 13,
|
||||
'hrp': 'nc',
|
||||
'bip44': 7,
|
||||
'min_amount': 1000,
|
||||
'max_amount': 100000 * COIN,
|
||||
},
|
||||
'testnet': {
|
||||
'rpcport': 18336,
|
||||
'pubkey_address': 111,
|
||||
'script_address': 196,
|
||||
'hrp': 'tn',
|
||||
'bip44': 1,
|
||||
'min_amount': 1000,
|
||||
'max_amount': 100000 * COIN,
|
||||
'name': 'testnet3',
|
||||
},
|
||||
'regtest': {
|
||||
'rpcport': 18443,
|
||||
'pubkey_address': 111,
|
||||
'script_address': 196,
|
||||
'hrp': 'ncrt',
|
||||
'bip44': 1,
|
||||
'min_amount': 1000,
|
||||
'max_amount': 100000 * COIN,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue