Skip to content

Conversation

@ziggie1984
Copy link
Collaborator

@ziggie1984 ziggie1984 commented Oct 30, 2025

In case we have a channel.backup file which as partly valid
channels we skip over them.

We also print out the funding script so we can verify some of the derivation paths regarding this channel are correct.

@ziggie1984 ziggie1984 force-pushed the update-fixoldchannel-cmd branch from 5c18b24 to 9941365 Compare October 30, 2025 15:49
@ziggie1984 ziggie1984 marked this pull request as ready for review October 30, 2025 15:51
@ziggie1984 ziggie1984 self-assigned this Oct 30, 2025
@guggero guggero requested review from Copilot and guggero October 31, 2025 15:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the fixoldbackup command to display funding multisig P2WSH witness program hashes when fixing old channel backups affected by lnd issue #3881. It introduces a new PubKeyForDescriptor helper method and defines a named error for better error handling.

Key changes:

  • Added ErrNoPublicKeyProvided as a named error constant for improved error handling
  • Implemented PubKeyForDescriptor method to derive public keys from key descriptors
  • Enhanced backup fixing logic to compute and log funding multisig P2WSH hashes before fixing invalid channels

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lnd/hdkeychain.go Added ErrNoPublicKeyProvided error constant, refactored CheckDescriptor to use it, and added new PubKeyForDescriptor helper method
cmd/chantools/fixoldbackup.go Enhanced channel backup fixing to handle ErrNoPublicKeyProvided, compute and log funding multisig P2WSH hashes, and improved log formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


msHash, err := input.WitnessScriptHash(msScript)
if err != nil {
return fmt.Errorf("could not compute"+
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Missing space after 'compute' in error message.

Suggested change
return fmt.Errorf("could not compute"+
return fmt.Errorf("could not compute "+

Copilot uses AI. Check for mistakes.
In case we have a channel.backup file which as partly valid
channels we skip over them.
@ziggie1984 ziggie1984 force-pushed the update-fixoldchannel-cmd branch from 9941365 to 1923257 Compare November 2, 2025 21:42
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.

LGTM, thanks!

@guggero guggero merged commit 8049650 into lightninglabs:master Nov 6, 2025
3 checks passed
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