Skip to content

Commit

Permalink
doublespendinputs: remove RBF argument, RBF always on
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrix42 committed Jan 29, 2024
1 parent 3b50a5c commit d9af0e3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 1 addition & 14 deletions cmd/chantools/doublespendinputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type doubleSpendInputs struct {
SweepAddr string
FeeRate uint32
RecoveryWindow uint32
Rbf bool

rootKey *rootKey
cmd *cobra.Command
Expand All @@ -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,
}
Expand All @@ -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",
Expand Down Expand Up @@ -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,
})
}

Expand Down
2 changes: 0 additions & 2 deletions doc/chantools_doublespendinputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ chantools doublespendinputs \
--inputoutpoints xxxxxxxxx:y,xxxxxxxxx:y \
--sweepaddr bc1q..... \
--feerate 10 \
--rbf=true \
--publish
```

Expand All @@ -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
Expand Down

0 comments on commit d9af0e3

Please sign in to comment.