lnwallet+channeldb: add new AuxLeafStore for dynamic aux leaves

In this commit, we add a new AuxLeafStore which can be used to dynamically fetch the latest aux leaves for a given state. This is useful for custom channel types that will store some extra information in the form of a custom blob, then will use that information to derive the new leaf tapscript leaves that may be attached to reach state.
This commit is contained in:
Olaoluwa Osuntokun authored and Oliver Gugger committed 2024-08-28 13:21:08 +02:00
1 parent c36cd9298f
commit d95c1f93f3
6 files changed
+430 -45

No files matched your search

+2 -1
View File
@@ -431,7 +431,7 @@ func (c *chainWatcher) handleUnknownLocalState(
}
remoteScript, _, err := lnwallet.CommitScriptToRemote(
c.cfg.chanState.ChanType, c.cfg.chanState.IsInitiator,
commitKeyRing.ToRemoteKey, leaseExpiry,
commitKeyRing.ToRemoteKey, leaseExpiry, input.NoneTapLeaf(),
)
if err != nil {
return false, err
@@ -444,6 +444,7 @@ func (c *chainWatcher) handleUnknownLocalState(
c.cfg.chanState.ChanType, c.cfg.chanState.IsInitiator,
commitKeyRing.ToLocalKey, commitKeyRing.RevocationKey,
uint32(c.cfg.chanState.LocalChanCfg.CsvDelay), leaseExpiry,
input.NoneTapLeaf(),
)
if err != nil {
return false, err