From 95729275b6be8608d0b6dee1870f89f0df144e6f Mon Sep 17 00:00:00 2001 From: tecnovert Date: Thu, 25 Jul 2019 20:09:46 +0200 Subject: [PATCH] html: display estimated contract fee on the wallets page.. --- basicswap/chainparams.py | 2 +- basicswap/http_server.py | 4 ++++ bin/basicswap_prepare.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/basicswap/chainparams.py b/basicswap/chainparams.py index 2ad7827..d6e0f85 100644 --- a/basicswap/chainparams.py +++ b/basicswap/chainparams.py @@ -77,7 +77,7 @@ chainparams = { 'bip44': 1, 'min_amount': 1000, 'max_amount': 100000 * COIN, - 'name': 'testnet4', + 'name': 'testnet3', }, 'regtest': { 'rpcport': 18443, diff --git a/basicswap/http_server.py b/basicswap/http_server.py index fa7c9a7..f341594 100644 --- a/basicswap/http_server.py +++ b/basicswap/http_server.py @@ -139,12 +139,16 @@ class HttpHandler(BaseHTTPRequestHandler): if 'error' in w: content += '

Error: {}

'.format(w['error']) + fee_rate = swap_client.getFeeRateForCoin(k) + tx_vsize = swap_client.getContractSpendTxVSize(k) + est_fee = (fee_rate * tx_vsize) / 1000 content += '' \ + '' \ + '' \ + '' \ + '' \ + '' \ + + '' \ + '
Balance:' + w['balance'] + '
Blocks:' + str(w['blocks']) + '
Synced:' + str(w['synced']) + '
' + str(w['deposit_address']) + '
Amount: Address: Subtract fee:
Fee Rate:' + format8(fee_rate * COIN) + 'Est Fee:' + format8(est_fee * COIN) + '
' content += '' diff --git a/bin/basicswap_prepare.py b/bin/basicswap_prepare.py index 6b99c52..8ce38d1 100644 --- a/bin/basicswap_prepare.py +++ b/bin/basicswap_prepare.py @@ -373,7 +373,8 @@ def main(): 'rpcport': 19796 + port_offset, 'datadir': os.path.join(data_dir, 'bitcoin'), 'bindir': os.path.join(data_dir, 'bin', 'bitcoin'), - 'use_segwit': True + 'use_segwit': True, + 'blocks_confirmed': 1 }, 'namecoin': { 'connection_type': 'rpc' if 'namecoin' in with_coins else 'none',