Browse Source

make transactions BIP-125 replace-by-fee by default

The MMGen Project 1 year ago
parent
commit
6f0751b8c9

+ 1 - 1
mmgen/data/version

@@ -1 +1 @@
-14.1.dev13
+14.1.dev14

+ 2 - 1
mmgen/main_split.py

@@ -43,7 +43,8 @@ opts_data = {
 -m, --minconf=     n Minimum number of confirmations required to spend
                      outputs (default: 1)
 -q, --quiet          Suppress warnings; overwrite files without prompting
--r, --rbf            Make transaction BIP 125 replaceable (replace-by-fee)
+-R, --no-rbf         Make transaction non-replaceable (non-replace-by-fee
+                     according to BIP 125)
 -v, --verbose        Produce more verbose output
 -y, --yes            Answer 'yes' to prompts, suppress non-essential output
 -R, --rpc-host2=   h Host the other coin daemon is running on (default: none)

+ 2 - 1
mmgen/main_txcreate.py

@@ -55,7 +55,8 @@ opts_data = {
 -m, --minconf=     n  Minimum number of confirmations required to spend
                       outputs (default: 1)
 -q, --quiet           Suppress warnings; overwrite files without prompting
--r, --rbf             Make transaction BIP 125 replaceable (replace-by-fee)
+-R, --no-rbf          Make transaction non-replaceable (non-replace-by-fee
+                      according to BIP 125)
 -v, --verbose         Produce more verbose output
 -V, --vsize-adj=   f  Adjust transaction's estimated vsize by factor 'f'
 -y, --yes             Answer 'yes' to prompts, suppress non-essential output

+ 2 - 1
mmgen/main_txdo.py

@@ -75,7 +75,8 @@ opts_data = {
 -p, --hash-preset=   p Use the scrypt hash parameters defined by preset 'p'
                        for password hashing (default: '{gc.dfl_hash_preset}')
 -P, --passwd-file=   f Get {pnm} wallet passphrase from file 'f'
--r, --rbf              Make transaction BIP 125 (replace-by-fee) replaceable
+-R, --no-rbf           Make transaction non-replaceable (non-replace-by-fee
+                       according to BIP 125)
 -q, --quiet            Suppress warnings; overwrite files without prompting
 -u, --subseeds=      n The number of subseed pairs to scan for (default: {ss},
                        maximum: {ss_max}). Only the default or first supplied

+ 2 - 1
mmgen/proto/btc/tx/new.py

@@ -113,7 +113,8 @@ class New(Base,TxBase.New):
 		if not bump:
 			self.inputs.sort_bip69()
 			# Set all sequence numbers to the same value, in conformity with the behavior of most modern wallets:
-			seqnum_val = self.proto.max_int - (2 if self.cfg.rbf else 1 if locktime else 0)
+			do_rbf = self.proto.cap('rbf') and not self.cfg.no_rbf
+			seqnum_val = self.proto.max_int - (2 if do_rbf else 1 if locktime else 0)
 			for i in self.inputs:
 				i.sequence = seqnum_val
 

+ 1 - 1
test/cmdtest_py_d/ct_main.py

@@ -629,7 +629,7 @@ class CmdTestMain(CmdTestBase,CmdTestShared):
 
 		t = self.spawn(
 			'mmgen-'+('txcreate','txdo')[bool(txdo_args)],
-			([],['--rbf'])[self.proto.cap('rbf')] +
+			(['--no-rbf'],[])[self.proto.cap('rbf')] +
 			['-f',self.tx_fee,'-B'] + add_args + cmd_args + txdo_args)
 
 		if t.expect([('Get','Unsigned transac')[cmdline_inputs],r'Unable to connect to \S+'],regex=True) == 1:

+ 2 - 2
test/cmdtest_py_d/ct_regtest.py

@@ -986,7 +986,7 @@ class CmdTestRegtest(CmdTestBase,CmdTestShared):
 		if not self.test_rbf:
 			return 'skip'
 		out_addr = self._create_tx_outputs('alice',(('B',5,''),))
-		t = self.spawn('mmgen-txcreate',['-d',self.tr.trash_dir,'-B','--bob','--rbf'] + out_addr)
+		t = self.spawn('mmgen-txcreate',['-d',self.tr.trash_dir,'-B','--bob'] + out_addr)
 		return self.txcreate_ui_common(t,menu=[],inputs='3',interactive_fee='3s') # out amt: 199.99999343
 
 	def bob_rbf_1output_bump(self):
@@ -1006,7 +1006,7 @@ class CmdTestRegtest(CmdTestBase,CmdTestShared):
 		outputs_cl = self._create_tx_outputs('alice',(('L',1,',60'),('C',1,',40'))) # alice_sid:L:1, alice_sid:C:1
 		outputs_cl += [self._user_sid('bob')+':'+rtBobOp3]
 		return self.user_txdo('bob',rtFee[1],outputs_cl,'3',
-					extra_args = ([],['--rbf'])[self.proto.cap('rbf')],
+					extra_args = (['--no-rbf'],[])[self.proto.cap('rbf')],
 					used_chg_addr_resp = 'y' )
 
 	def bob_send_non_mmgen(self):