Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle RBF signaling publication failures in wallet #3510

Merged
merged 4 commits into from Sep 25, 2019

Conversation

@halseth
Copy link
Collaborator

commented Sep 16, 2019

Earlier we would not return ErrDoubleSpend if a transaction failed to publish because there was an existing, RBF-signaling, transaction in the mempool. This could happen in cases where we attempted to force close the channel, but a different closing transaction was already broadcasted.

Now we'll properly now that this error is not critical, such that we can continue resolving the closing channel.

Depends on btcsuite/btcwallet#647

Needed for #3016

@halseth halseth requested a review from Roasbeef as a code owner Sep 16, 2019
@halseth halseth added this to the 0.8.0 milestone Sep 16, 2019
@wpaulino wpaulino self-requested a review Sep 16, 2019
lnwallet/interface_test.go Outdated Show resolved Hide resolved
lnwallet/btcwallet/btcwallet.go Outdated Show resolved Hide resolved
lnwallet/btcwallet/btcwallet.go Outdated Show resolved Hide resolved
lnwallet/btcwallet/btcwallet.go Outdated Show resolved Hide resolved
lnwallet/btcwallet/btcwallet.go Outdated Show resolved Hide resolved
lnwallet/btcwallet/btcwallet.go Outdated Show resolved Hide resolved
@halseth halseth force-pushed the halseth:lnwallet-rbf branch from 36be1b6 to 990a448 Sep 19, 2019
go.mod Outdated
@@ -58,6 +58,8 @@ replace github.com/lightningnetwork/lnd/ticker => ./ticker

replace github.com/lightningnetwork/lnd/queue => ./queue

replace github.com/btcsuite/btcwallet => github.com/halseth/btcwallet v0.0.0-20190919123305-ca06abc72b9c

This comment has been minimized.

Copy link
@halseth

halseth Sep 19, 2019

Author Collaborator

Note to self: remove when btcwallet PR is merged.

@halseth halseth force-pushed the halseth:lnwallet-rbf branch from 990a448 to 5b92c80 Sep 19, 2019
@halseth halseth force-pushed the halseth:lnwallet-rbf branch from 5b92c80 to 2b8f7f6 Sep 20, 2019
@halseth

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 20, 2019

Reveiw addressed. PTAL @Roasbeef @wpaulino

@halseth halseth requested review from Roasbeef and wpaulino Sep 20, 2019
Copy link
Collaborator

left a comment

Nice cleanup! Changes LGTM pending approval of the dependent btcwallet PR.

Copy link
Member

left a comment

LGTM 💿

Merged pending inclusion of the dependent btcwallet PR.

halseth added 4 commits Sep 19, 2019
In preparation for extending the testPublishTransaction test, shorten it
by moving utility methods out of the local scope.
We update to a new version of btcwallet where specific errors
(ErrDoubleSpend and ErrReplacement) will be returned from
PublishTransaction.
Checks that we get ErrDoubleSpend as expected when publishing a
conflicting mempool transaction with the same fee as the existing one,
and that we can publish a replacement with a higher fee successfully.
error

Since btcwallet will return typed errors now, we can simplify the
matching logic in order to return ErrDoubleSpend.

In case a transaction cannot be published since it did not satisfy the
requirements for a valid replacement, return ErrDoubleSpend to indicate
it was not propagated.
@halseth halseth force-pushed the halseth:lnwallet-rbf branch from 2b8f7f6 to 2e94529 Sep 25, 2019
@halseth

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 25, 2019

btcwallet PR merged, and dependency updated.

@halseth halseth merged commit b7e1bb0 into lightningnetwork:master Sep 25, 2019
1 of 2 checks passed
1 of 2 checks passed
coverage/coveralls Coverage decreased (-0.02%) to 63.124%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.