channeldb: Add upfront shutdown script to OpenChannel

This commit adds fields for upfront shutdown scripts set
by the local and remote peer to the OpenChannel struct.
These values are optional, so they are added with their
own keys in the chanBucket in the DB.
This commit is contained in:
carla committed 2019-12-03 11:38:29 +02:00
1 parent f86d63144c
commit 77222d8b69
3 files changed
+181 -4

No files matched your search

+2 -2
View File
@@ -4921,13 +4921,13 @@ func (lc *LightningChannel) ShortChanID() lnwire.ShortChannelID {
// LocalUpfrontShutdownScript returns the local upfront shutdown script for the
// channel. If it was not set, an empty byte array is returned.
func (lc *LightningChannel) LocalUpfrontShutdownScript() lnwire.DeliveryAddress {
return nil
return lc.channelState.LocalShutdownScript
}
// RemoteUpfrontShutdownScript returns the remote upfront shutdown script for the
// channel. If it was not set, an empty byte array is returned.
func (lc *LightningChannel) RemoteUpfrontShutdownScript() lnwire.DeliveryAddress {
return nil
return lc.channelState.RemoteShutdownScript
}
// genHtlcScript generates the proper P2WSH public key scripts for the HTLC