channeldb/channel: add property ChanStatus in place of IsBorked to OpenChannel

This commit changes the bool `IsBorked` in OpenChannel to a `ChanStatus`
struct, of type ChannelStatus. This is used to indicated that a channel
that is technically still open, is either borked, or has had a
commitment broadcasted, but is not confirmed on-chain yet.

The ChannelStatus type has the value 1 for the status Borked, meaning it
is backwards compatible with the old database format.
This commit is contained in:
Johan T. Halseth committed 2018-04-25 09:37:23 +02:00
1 parent d2d87758f7
commit b7bb53a8b8
2 files changed
+71 -20

No files matched your search

+1 -1
View File
@@ -4754,7 +4754,7 @@ func NewUnilateralCloseSummary(chanState *channeldb.OpenChannel, signer Signer,
RemotePub: chanState.IdentityPub,
Capacity: chanState.Capacity,
SettledBalance: localBalance,
CloseType: channeldb.ForceClose,
CloseType: channeldb.RemoteForceClose,
IsPending: true,
}