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:
carla committed 2020-02-21 13:33:53 +02:00
1 parent d3cb6ad869
commit 11d975bd13
4 files changed
+60 -6

No files matched your search

+3 -2
View File
@@ -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