channeldb: add new frozen channel type bit and thaw height
In this commit, we add a new channel type bit: a frozen channel. A frozen channel is one that can only be cooperatively closed by the responder, but not the initiator. This channel type is useful for certain classes of channel factory like protocols. We then add a new key on the channel bucket level to store the height after which this restriction no longer applies.
This commit is contained in:
2 files changed
+82
-1
No files matched your search
@@ -349,7 +349,7 @@ func createTestChannelState(t *testing.T, cdb *DB) *OpenChannel {
|
||||
chanID := lnwire.NewShortChanIDFromInt(uint64(rand.Int63()))
|
||||
|
||||
return &OpenChannel{
|
||||
ChanType: SingleFunderBit,
|
||||
ChanType: SingleFunderBit | FrozenBit,
|
||||
ChainHash: key,
|
||||
FundingOutpoint: wire.OutPoint{Hash: key, Index: rand.Uint32()},
|
||||
ShortChannelID: chanID,
|
||||
@@ -387,6 +387,7 @@ func createTestChannelState(t *testing.T, cdb *DB) *OpenChannel {
|
||||
Db: cdb,
|
||||
Packager: NewChannelPackager(chanID),
|
||||
FundingTxn: testTx,
|
||||
ThawHeight: uint32(defaultPendingHeight),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user