Merge pull request #3141 from SomberNight/locktime_local_height
txn: set locktime to local height for RBF, CPFP, sweep
This commit is contained in:
commit
8467663448
|
@ -919,7 +919,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()))
|
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)]
|
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.set_rbf(True)
|
||||||
tx.sign(keypairs)
|
tx.sign(keypairs)
|
||||||
return tx
|
return tx
|
||||||
|
@ -1060,7 +1062,8 @@ class Abstract_Wallet(PrintError):
|
||||||
continue
|
continue
|
||||||
if delta > 0:
|
if delta > 0:
|
||||||
raise BaseException(_('Cannot bump fee: could not find suitable outputs'))
|
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):
|
def cpfp(self, tx, fee):
|
||||||
txid = tx.txid()
|
txid = tx.txid()
|
||||||
|
@ -1077,7 +1080,8 @@ class Abstract_Wallet(PrintError):
|
||||||
self.add_input_info(item)
|
self.add_input_info(item)
|
||||||
inputs = [item]
|
inputs = [item]
|
||||||
outputs = [(TYPE_ADDRESS, address, value - fee)]
|
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):
|
def add_input_info(self, txin):
|
||||||
address = txin['address']
|
address = txin['address']
|
||||||
|
|
Loading…
Reference in New Issue