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

pool: daemon crashes if unable to reconcile local order state w/ a replaced pending batch #365

Open
Roasbeef opened this issue May 25, 2022 · 0 comments
Labels
batch bug Something isn't working orders recovery

Comments

@Roasbeef
Copy link
Member

Reported by a Lightning Terminal user:

[ERR] LITD: Could not start subservers: unable to start account manager: unable to resume account X: unable to subscribe for account updates: checking pending batch failed: error removing pending batch artifacts: error abandoning channels from previous pending batch: error locating channel outpoint: no channel output found in batch tx for matched order Y

The start of the failed code path is here: https://github.com/lightninglabs/pool/blob/master/auctioneer/client.go#L579-L587

We go to abandon the channel shims we have have created:

pool/funding/manager.go

Lines 999 to 1005 in 3e49f4c

// Also abandon any channels that might still be pending
// from a previous round of the same batch or a previous
// batch that we didn't make it into the final round.
err = AbandonCanceledChannels(
matchedOrders, batchTx, m.cfg.WalletKit, m.cfg.BaseClient,
m.cfg.DB.GetOrder,
)

Ultimately failing here when it can't find an output its looking for in the batch execution transaction:

pool/funding/batch.go

Lines 95 to 105 in 3e49f4c

// For each ask order that was matched with this bid, we'll
// locate the channel outpoint then abandon it from lnd's
// channel database.
for _, matchedOrder := range matchedOrders {
_, idx, err := order.ChannelOutput(
batchTx, wallet, ourOrder, matchedOrder,
)
if err != nil {
return fmt.Errorf("error locating channel "+
"outpoint: %v", err)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
batch bug Something isn't working orders recovery
Projects
None yet
Development

No branches or pull requests

1 participant