lnd: use chanstate Store for channel restore
What changed, and why it matters
This is a small internal code cleanup in LND. It changes one component (the channel restorer) to use a more abstract storage interface instead of a specific database implementation. There is no indication this fixes a security bug or introduces a vulnerability; it appears to be a refactoring to make the code more modular and easier to test.
No security action needed. Treat as routine refactoring. If reviewing for release notes, note it as a code-quality/internal architecture change only.
Security signals we found
No security-relevant behavioral change in the diff
Refactoring from concrete type to interface (dependency inversion)
No input validation, cryptographic, or authorization changes
No incident or vulnerability disclosure referenced
Evidence from the diff
The commit modifies chanrestore.go so that chanDBRestorer depends on chanstate.OpenChannelStore (an interface) rather than the concrete *channeldb.ChannelStateDB. The restorer still constructs channeldb channel shell values, but now only requires the RestoreChannelShells method from the store. This is a dependency-inversion refactor with no functional change visible in the diff.
Changed components
lnd/chanrestore.gochanDBRestorerchannel restore pathInspect captured patch +2 / −1
diff --git a/chanrestore.go b/chanrestore.go
index 1f506cc..407cdfb 100644
--- a/chanrestore.go
+++ b/chanrestore.go
@@ -11,6 +11,7 @@ import (
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/chanbackup"
"github.com/lightningnetwork/lnd/channeldb"
+ "github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/contractcourt"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnwire"
@@ -35,7 +36,7 @@ const (
// need the secret key chain in order obtain the prior shachain root so we can
// verify the DLP protocol as initiated by the remote node.
type chanDBRestorer struct {
- db *channeldb.ChannelStateDB
+ db chanstate.OpenChannelStore
secretKeys keychain.SecretKeyRing
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.