From d9af0e36e5afcaa71fb9aa5eea1a2e094f50939e Mon Sep 17 00:00:00 2001 From: Felix Passenberg Date: Mon, 29 Jan 2024 16:11:01 +0100 Subject: [PATCH] doublespendinputs: remove RBF argument, RBF always on --- cmd/chantools/doublespendinputs.go | 15 +-------------- doc/chantools_doublespendinputs.md | 2 -- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/cmd/chantools/doublespendinputs.go b/cmd/chantools/doublespendinputs.go index d529a12..532228b 100644 --- a/cmd/chantools/doublespendinputs.go +++ b/cmd/chantools/doublespendinputs.go @@ -27,7 +27,6 @@ type doubleSpendInputs struct { SweepAddr string FeeRate uint32 RecoveryWindow uint32 - Rbf bool rootKey *rootKey cmd *cobra.Command @@ -45,7 +44,6 @@ only be used with inputs that belong to an lnd wallet.`, --inputoutpoints xxxxxxxxx:y,xxxxxxxxx:y \ --sweepaddr bc1q..... \ --feerate 10 \ - --rbf=true \ --publish`, RunE: cc.Execute, } @@ -71,10 +69,6 @@ only be used with inputs that belong to an lnd wallet.`, "number of keys to scan per internal/external branch; output "+ "will consist of double this amount of keys", ) - cc.cmd.Flags().BoolVar( - &cc.Rbf, "rbf", true, "choose RBF flag for this double spend "+ - "transaction. (Be sure to use '=' with this argument)", - ) cc.cmd.Flags().BoolVar( &cc.Publish, "publish", false, "publish replacement TX to "+ "the chain API instead of just printing the TX", @@ -237,18 +231,11 @@ func (c *doubleSpendInputs) Execute(_ *cobra.Command, _ []string) error { // Create the transaction. tx := wire.NewMsgTx(2) - // enable/disable RBF - var sequence uint32 = mempool.MaxRBFSequence - if !c.Rbf { - sequence = wire.MaxTxInSequenceNum - } - // Add the inputs. for _, outpoint := range outpoints { - tx.AddTxIn(&wire.TxIn{ PreviousOutPoint: *outpoint, - Sequence: sequence, + Sequence: mempool.MaxRBFSequence, }) } diff --git a/doc/chantools_doublespendinputs.md b/doc/chantools_doublespendinputs.md index e683594..fe6b5a6 100644 --- a/doc/chantools_doublespendinputs.md +++ b/doc/chantools_doublespendinputs.md @@ -19,7 +19,6 @@ chantools doublespendinputs \ --inputoutpoints xxxxxxxxx:y,xxxxxxxxx:y \ --sweepaddr bc1q..... \ --feerate 10 \ - --rbf=true \ --publish ``` @@ -32,7 +31,6 @@ chantools doublespendinputs \ -h, --help help for doublespendinputs --inputoutpoints strings list of outpoints to double spend in the format txid:vout --publish publish replacement TX to the chain API instead of just printing the TX - --rbf choose RBF flag for this double spend transaction. (Be sure to use '=' with this argument) (default true) --recoverywindow uint32 number of keys to scan per internal/external branch; output will consist of double this amount of keys (default 2500) --rootkey string BIP32 HD root key of the wallet to use for deriving the input keys; leave empty to prompt for lnd 24 word aezeed --sweepaddr string address to recover the funds to; specify 'fromseed' to derive a new address from the seed automatically