mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-14 10:29:29 +02:00
channeldb: add ChannelFlags to OpenChannel struct
This commit adds the ChannelFlags field, of type lnwire.FundingFlags, to the OpenChannel struct, including serialization for database storage. This is done to preserve the flags that were sent during channel opening, currently used to determine whether a channel should be made public or not after opening.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
17d1d5dc9c
commit
48e22219c0
@@ -135,6 +135,10 @@ func writeElement(w io.Writer, element interface{}) error {
|
||||
if err := binary.Write(w, byteOrder, e); err != nil {
|
||||
return err
|
||||
}
|
||||
case lnwire.FundingFlag:
|
||||
if err := binary.Write(w, byteOrder, e); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
default:
|
||||
return fmt.Errorf("Unknown type in writeElement: %T", e)
|
||||
@@ -287,6 +291,10 @@ func readElement(r io.Reader, element interface{}) error {
|
||||
if err := binary.Read(r, byteOrder, e); err != nil {
|
||||
return err
|
||||
}
|
||||
case *lnwire.FundingFlag:
|
||||
if err := binary.Read(r, byteOrder, e); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
default:
|
||||
return fmt.Errorf("Unknown type in readElement: %T", e)
|
||||
|
Reference in New Issue
Block a user