1
0

add CPFP (child pays for parent) dialog to the Qt GUI

This commit is contained in:
ThomasV
2017-02-01 12:26:30 +01:00
parent 9e1931587d
commit 15b404b9de
3 changed files with 55 additions and 3 deletions

View File

@@ -1042,6 +1042,25 @@ class Abstract_Wallet(PrintError):
raise BaseException(_('Cannot bump fee: cound not find suitable outputs'))
return Transaction.from_io(inputs, outputs)
def cpfp(self, tx, fee):
txid = tx.txid()
for i, o in enumerate(tx.outputs()):
otype, address, value = o
if otype == TYPE_ADDRESS and self.is_mine(address):
break
else:
return
coins = self.get_addr_utxo(address)
for item in coins:
if item['prevout_hash'] == txid and item['prevout_n'] == i:
break
else:
return
self.add_input_info(item)
inputs = [item]
outputs = [(TYPE_ADDRESS, address, value - fee)]
return Transaction.from_io(inputs, outputs)
def add_input_info(self, txin):
# Add address for utxo that are in wallet
if txin.get('scriptSig') == '':