channeldb: save channel status on channel close
Add an optional channel status CloseChannel which will be stored on the hitsorical channel which is persisted at channel close. This status is used to set the close initiator for channels that do not complete the funding flow or we abandon. In follow up commits, this status will be used to record force and breach closes. The value is written to the historical channel bucket for diplay over rpc.
This commit is contained in:
4 files changed
+60
-6
No files matched your search
+3
-2
@@ -1159,8 +1159,9 @@ func (d *DB) AbandonChannel(chanPoint *wire.OutPoint, bestHeight uint32) error {
|
||||
}
|
||||
|
||||
// Finally, we'll close the channel in the DB, and return back to the
|
||||
// caller.
|
||||
return dbChan.CloseChannel(summary)
|
||||
// caller. We set ourselves as the close initiator because we abandoned
|
||||
// the channel.
|
||||
return dbChan.CloseChannel(summary, ChanStatusLocalCloseInitiator)
|
||||
}
|
||||
|
||||
// syncVersions function is used for safe db version synchronization. It
|
||||
|
||||
Reference in new issue
Block a user