diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 657b9f4..51ef3a8 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -802,9 +802,9 @@ class BasicSwap(): ticker = 'rt' + ticker return ticker - def withdrawCoin(self, coin_type, value, addr_to): - self.log.info('withdrawCoin %s %s to %s', value, self.getTicker(coin_type), addr_to) - return self.callcoinrpc(coin_type, 'sendtoaddress', [addr_to, value]) + def withdrawCoin(self, coin_type, value, addr_to, subfee): + self.log.info('withdrawCoin %s %s to %s %s', value, self.getTicker(coin_type), addr_to, ' subfee' if subfee else '') + return self.callcoinrpc(coin_type, 'sendtoaddress', [addr_to, value, '', '', subfee]) def cacheNewAddressForCoin(self, coin_type): self.log.debug('cacheNewAddressForCoin %s', coin_type) diff --git a/basicswap/http_server.py b/basicswap/http_server.py index d73f567..4fc913d 100644 --- a/basicswap/http_server.py +++ b/basicswap/http_server.py @@ -119,7 +119,8 @@ class HttpHandler(BaseHTTPRequestHandler): if bytes('withdraw_' + cid, 'utf-8') in form_data: value = form_data[bytes('amt_' + cid, 'utf-8')][0].decode('utf-8') address = form_data[bytes('to_' + cid, 'utf-8')][0].decode('utf-8') - txid = swap_client.withdrawCoin(c, value, address) + subfee = True if bytes('subfee_' + cid, 'utf-8') in form_data else False + txid = swap_client.withdrawCoin(c, value, address, subfee) ticker = swap_client.getTicker(c) content += '

Withdrew {} {} to address {}
In txid: {}

'.format(value, ticker, address, txid) @@ -134,7 +135,7 @@ class HttpHandler(BaseHTTPRequestHandler): + 'Blocks:' + str(w['blocks']) + '' \ + 'Synced:' + str(w['synced']) + '' \ + '' + str(w['deposit_address']) + '' \ - + 'Amount: Address: ' \ + + 'Amount: Address: Subtract fee: ' \ + '' content += ''