use maxint-2 to signal RBF, in order to standardize with Bitcoin Core
This commit is contained in:
@@ -414,7 +414,7 @@ class Commands:
|
||||
coins = self.wallet.get_spendable_coins(domain)
|
||||
tx = self.wallet.make_unsigned_transaction(coins, final_outputs, self.config, fee, change_addr)
|
||||
if rbf:
|
||||
tx.set_sequence(0)
|
||||
tx.set_rbf(True)
|
||||
if not unsigned:
|
||||
self.wallet.sign_transaction(tx, self._password)
|
||||
return tx
|
||||
|
||||
@@ -681,9 +681,10 @@ class Transaction:
|
||||
s += int_to_hex(txin.get('sequence', 0xffffffff), 4)
|
||||
return s
|
||||
|
||||
def set_sequence(self, n):
|
||||
def set_rbf(self, rbf):
|
||||
nSequence = 0xffffffff - (2 if rbf else 0)
|
||||
for txin in self.inputs():
|
||||
txin['sequence'] = n
|
||||
txin['sequence'] = nSequence
|
||||
|
||||
def BIP_LI01_sort(self):
|
||||
# See https://github.com/kristovatlas/rfc/blob/master/bips/bip-li01.mediawiki
|
||||
|
||||
Reference in New Issue
Block a user