txn: set locktime to local height for RBF, CPFP, sweep

This commit is contained in:
SomberNight 2017-10-28 10:02:37 +02:00
parent 6f3c822867
commit 211fa9a062
1 changed files with 7 additions and 3 deletions

View File

@ -920,7 +920,9 @@ class Abstract_Wallet(PrintError):
raise BaseException(_('Not enough funds on address.') + '\nTotal: %d satoshis\nFee: %d\nDust Threshold: %d'%(total, fee, self.dust_threshold()))
outputs = [(TYPE_ADDRESS, recipient, total - fee)]
tx = Transaction.from_io(inputs, outputs)
locktime = self.get_local_height()
tx = Transaction.from_io(inputs, outputs, locktime=locktime)
tx.set_rbf(True)
tx.sign(keypairs)
return tx
@ -1061,7 +1063,8 @@ class Abstract_Wallet(PrintError):
continue
if delta > 0:
raise BaseException(_('Cannot bump fee: could not find suitable outputs'))
return Transaction.from_io(inputs, outputs)
locktime = self.get_local_height()
return Transaction.from_io(inputs, outputs, locktime=locktime)
def cpfp(self, tx, fee):
txid = tx.txid()
@ -1078,7 +1081,8 @@ class Abstract_Wallet(PrintError):
self.add_input_info(item)
inputs = [item]
outputs = [(TYPE_ADDRESS, address, value - fee)]
return Transaction.from_io(inputs, outputs)
locktime = self.get_local_height()
return Transaction.from_io(inputs, outputs, locktime=locktime)
def add_input_info(self, txin):
address = txin['address']