Merge pull request #3581 from SomberNight/bip_li01_sort_rbf_sweep
RBF/sweep: use BIP_LI01_sort()
This commit is contained in:
commit
13bf539d17
|
@ -146,6 +146,7 @@ def sweep(privkeys, network, config, recipient, fee=None, imax=100):
|
||||||
locktime = network.get_local_height()
|
locktime = network.get_local_height()
|
||||||
|
|
||||||
tx = Transaction.from_io(inputs, outputs, locktime=locktime)
|
tx = Transaction.from_io(inputs, outputs, locktime=locktime)
|
||||||
|
tx.BIP_LI01_sort()
|
||||||
tx.set_rbf(True)
|
tx.set_rbf(True)
|
||||||
tx.sign(keypairs)
|
tx.sign(keypairs)
|
||||||
return tx
|
return tx
|
||||||
|
@ -1080,7 +1081,9 @@ class Abstract_Wallet(PrintError):
|
||||||
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'))
|
||||||
locktime = self.get_local_height()
|
locktime = self.get_local_height()
|
||||||
return Transaction.from_io(inputs, outputs, locktime=locktime)
|
tx_new = Transaction.from_io(inputs, outputs, locktime=locktime)
|
||||||
|
tx_new.BIP_LI01_sort()
|
||||||
|
return tx_new
|
||||||
|
|
||||||
def cpfp(self, tx, fee):
|
def cpfp(self, tx, fee):
|
||||||
txid = tx.txid()
|
txid = tx.txid()
|
||||||
|
@ -1098,6 +1101,7 @@ class Abstract_Wallet(PrintError):
|
||||||
inputs = [item]
|
inputs = [item]
|
||||||
outputs = [(TYPE_ADDRESS, address, value - fee)]
|
outputs = [(TYPE_ADDRESS, address, value - fee)]
|
||||||
locktime = self.get_local_height()
|
locktime = self.get_local_height()
|
||||||
|
# note: no need to call tx.BIP_LI01_sort() here - single input/output
|
||||||
return Transaction.from_io(inputs, outputs, locktime=locktime)
|
return Transaction.from_io(inputs, outputs, locktime=locktime)
|
||||||
|
|
||||||
def add_input_info(self, txin):
|
def add_input_info(self, txin):
|
||||||
|
|
Loading…
Reference in New Issue