multi: convert the existing channeldb.ChannelType uint8 into a bit field
In this commit, we convert the existing `channeldb.ChannelType` type into a _bit field_. This doesn't require us to change the current serialization or interpretation or the type as it is, since all the current defined values us a distinct bit. This PR lays the ground work for any future changes that may introduce new channel types (like anchor outputs), and also any changes that may modify the existing invariants around channels (if we're the initiator, we always have the funding transaction).
This commit is contained in:
14 files changed
+42
-39
No files matched your search
+1
-1
@@ -521,7 +521,7 @@ func (f *fundingManager) start() error {
|
||||
// Rebroadcast the funding transaction for any pending
|
||||
// channel that we initiated. No error will be returned
|
||||
// if the transaction already has been broadcasted.
|
||||
if channel.ChanType == channeldb.SingleFunder &&
|
||||
if channel.ChanType.IsSingleFunder() &&
|
||||
channel.IsInitiator {
|
||||
|
||||
err := f.cfg.PublishTransaction(
|
||||
|
||||
Reference in new issue
Block a user