Skip to content

Conversation

Tetrix42
Copy link
Contributor

doublespendinputs is designed to replace transactions, those new transactions should also be replacable by default.

Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Though I don't think any action is really required? Since the flag would only allow you to turn off RBF, which I don't think is required really.

for _, outpoint := range outpoints {
tx.AddTxIn(wire.NewTxIn(outpoint, nil, nil))

tx.AddTxIn(&wire.TxIn{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AddTxIn already uses wire.MaxTxInSequenceNum under the hood. So I don't think any change is required? I don't think it makes sense to be able to turn off RBF?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default it usse is indeed

	// MaxTxInSequenceNum is the maximum sequence number the sequence field
	// of a transaction input can be.
	MaxTxInSequenceNum uint32 = 0xffffffff

but this value disallows RBF.

therefore to allow RBF this PR changes the default to

	// MaxRBFSequence is the maximum sequence number an input can use to
	// signal that the transaction spending it can be replaced using the
	// Replace-By-Fee (RBF) policy.
	MaxRBFSequence = 0xfffffffd

and introduces a switch to give the users the possibility to make a final transactions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right. I got the two values confused. So I guess we'll just want RBF to be the default, no need to turn it off. Removes the need for the boolean flag which has bad UX if the default is true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so i pushed new commit without the rbf flag.

Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM 🎉

@guggero guggero merged commit a0e5f06 into lightninglabs:master Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants