funding: update to adhere to new channels API's

This commit is contained in:
Olaoluwa Osuntokun 2017-11-10 15:21:42 -08:00
parent 431f6fc2c8
commit 2862b6e6f1
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21
1 changed files with 5 additions and 5 deletions

View File

@ -392,6 +392,7 @@ func (f *fundingManager) Start() error {
// to confirm, so we forget the channel and
// delete it from the database.
closeInfo := &channeldb.ChannelCloseSummary{
ChainHash: ch.ChainHash,
ChanPoint: ch.FundingOutpoint,
RemotePub: ch.IdentityPub,
CloseType: channeldb.FundingCanceled,
@ -668,8 +669,8 @@ func (f *fundingManager) handlePendingChannels(msg *pendingChansReq) {
identityPub: dbPendingChan.IdentityPub,
channelPoint: &dbPendingChan.FundingOutpoint,
capacity: dbPendingChan.Capacity,
localBalance: dbPendingChan.LocalBalance.ToSatoshis(),
remoteBalance: dbPendingChan.RemoteBalance.ToSatoshis(),
localBalance: dbPendingChan.LocalCommitment.LocalBalance.ToSatoshis(),
remoteBalance: dbPendingChan.LocalCommitment.RemoteBalance.ToSatoshis(),
}
pendingChannels = append(pendingChannels, pendingChan)
@ -1073,6 +1074,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) {
deleteFromDatabase := func() {
closeInfo := &channeldb.ChannelCloseSummary{
ChanPoint: completeChan.FundingOutpoint,
ChainHash: completeChan.ChainHash,
RemotePub: completeChan.IdentityPub,
CloseType: channeldb.FundingCanceled,
}
@ -1461,9 +1463,7 @@ func (f *fundingManager) waitForFundingConfirmation(completeChan *channeldb.Open
// Now that the channel has been fully confirmed, we'll mark it as open
// within the database.
completeChan.IsPending = false
err = f.cfg.Wallet.Cfg.Database.MarkChannelAsOpen(&fundingPoint, shortChanID)
if err != nil {
if err := completeChan.MarkAsOpen(shortChanID); err != nil {
fndgLog.Errorf("error setting channel pending flag to false: "+
"%v", err)
return