peer+lnwallet: update API usage to recent channeldb changes
This commit is contained in:
parent
7df1d75267
commit
34959e4648
@ -1011,14 +1011,15 @@ func (lc *LightningChannel) closeObserver(channelCloseNtfn *chainntnfs.SpendEven
|
|||||||
// immediately delete the state from disk, creating a close
|
// immediately delete the state from disk, creating a close
|
||||||
// summary for future usage by related sub-systems.
|
// summary for future usage by related sub-systems.
|
||||||
// TODO(roasbeef): include HTLC's
|
// TODO(roasbeef): include HTLC's
|
||||||
|
// * and time-locked balance
|
||||||
closeSummary := &channeldb.ChannelCloseSummary{
|
closeSummary := &channeldb.ChannelCloseSummary{
|
||||||
ChanPoint: *lc.channelState.ChanID,
|
ChanPoint: *lc.channelState.ChanID,
|
||||||
ClosingTXID: *commitSpend.SpenderTxHash,
|
ClosingTXID: *commitSpend.SpenderTxHash,
|
||||||
RemotePub: lc.channelState.IdentityPub,
|
RemotePub: lc.channelState.IdentityPub,
|
||||||
Capacity: lc.Capacity,
|
Capacity: lc.Capacity,
|
||||||
OurBalance: lc.channelState.OurBalance,
|
SettledBalance: lc.channelState.OurBalance,
|
||||||
CloseType: channeldb.ForceClose,
|
CloseType: channeldb.ForceClose,
|
||||||
IsPending: true,
|
IsPending: true,
|
||||||
}
|
}
|
||||||
if err := lc.DeleteState(closeSummary); err != nil {
|
if err := lc.DeleteState(closeSummary); err != nil {
|
||||||
walletLog.Errorf("unable to delete channel state: %v",
|
walletLog.Errorf("unable to delete channel state: %v",
|
||||||
|
28
peer.go
28
peer.go
@ -900,13 +900,13 @@ func (p *peer) handleLocalClose(req *closeLinkReq) {
|
|||||||
// closed within the database.
|
// closed within the database.
|
||||||
chanInfo := channel.StateSnapshot()
|
chanInfo := channel.StateSnapshot()
|
||||||
closeSummary := &channeldb.ChannelCloseSummary{
|
closeSummary := &channeldb.ChannelCloseSummary{
|
||||||
ChanPoint: *req.chanPoint,
|
ChanPoint: *req.chanPoint,
|
||||||
ClosingTXID: *closingTxid,
|
ClosingTXID: *closingTxid,
|
||||||
RemotePub: &chanInfo.RemoteIdentity,
|
RemotePub: &chanInfo.RemoteIdentity,
|
||||||
Capacity: chanInfo.Capacity,
|
Capacity: chanInfo.Capacity,
|
||||||
OurBalance: chanInfo.LocalBalance,
|
SettledBalance: chanInfo.LocalBalance,
|
||||||
CloseType: channeldb.CooperativeClose,
|
CloseType: channeldb.CooperativeClose,
|
||||||
IsPending: true,
|
IsPending: true,
|
||||||
}
|
}
|
||||||
if err := channel.DeleteState(closeSummary); err != nil {
|
if err := channel.DeleteState(closeSummary); err != nil {
|
||||||
req.err <- err
|
req.err <- err
|
||||||
@ -1025,13 +1025,13 @@ func (p *peer) handleRemoteClose(req *lnwire.CloseRequest) {
|
|||||||
closeTxid := closeTx.TxHash()
|
closeTxid := closeTx.TxHash()
|
||||||
chanInfo := channel.StateSnapshot()
|
chanInfo := channel.StateSnapshot()
|
||||||
closeSummary := &channeldb.ChannelCloseSummary{
|
closeSummary := &channeldb.ChannelCloseSummary{
|
||||||
ChanPoint: *chanPoint,
|
ChanPoint: *chanPoint,
|
||||||
ClosingTXID: closeTxid,
|
ClosingTXID: closeTxid,
|
||||||
RemotePub: &chanInfo.RemoteIdentity,
|
RemotePub: &chanInfo.RemoteIdentity,
|
||||||
Capacity: chanInfo.Capacity,
|
Capacity: chanInfo.Capacity,
|
||||||
OurBalance: chanInfo.LocalBalance,
|
SettledBalance: chanInfo.LocalBalance,
|
||||||
CloseType: channeldb.CooperativeClose,
|
CloseType: channeldb.CooperativeClose,
|
||||||
IsPending: true,
|
IsPending: true,
|
||||||
}
|
}
|
||||||
if err := channel.DeleteState(closeSummary); err != nil {
|
if err := channel.DeleteState(closeSummary); err != nil {
|
||||||
peerLog.Errorf("unable to delete channel state: %v", err)
|
peerLog.Errorf("unable to delete channel state: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user