multi: use mutex-guarded ShortChanID() on OpenChannel

This commit is contained in:
Conner Fromknecht
2018-05-01 16:27:20 -07:00
parent 19b5eaa4dc
commit f963f91a3c
13 changed files with 31 additions and 31 deletions

View File

@@ -180,7 +180,7 @@ func (c *chainWatcher) Start() error {
// As a height hint, we'll try to use the opening height, but if the
// channel isn't yet open, then we'll use the height it was broadcast
// at.
heightHint := chanState.ShortChanID.BlockHeight
heightHint := c.cfg.chanState.ShortChanID().BlockHeight
if heightHint == 0 {
heightHint = chanState.FundingBroadcastHeight
}
@@ -472,7 +472,7 @@ func (c *chainWatcher) dispatchCooperativeClose(commitSpend *chainntnfs.SpendDet
CloseHeight: uint32(commitSpend.SpendingHeight),
SettledBalance: localAmt,
CloseType: channeldb.CooperativeClose,
ShortChanID: c.cfg.chanState.ShortChanID,
ShortChanID: c.cfg.chanState.ShortChanID(),
IsPending: true,
}
err := c.cfg.chanState.CloseChannel(closeSummary)
@@ -564,7 +564,7 @@ func (c *chainWatcher) dispatchLocalForceClose(
Capacity: chanSnapshot.Capacity,
CloseType: channeldb.LocalForceClose,
IsPending: true,
ShortChanID: c.cfg.chanState.ShortChanID,
ShortChanID: c.cfg.chanState.ShortChanID(),
CloseHeight: uint32(commitSpend.SpendingHeight),
}
@@ -739,7 +739,7 @@ func (c *chainWatcher) dispatchContractBreach(spendEvent *chainntnfs.SpendDetail
SettledBalance: settledBalance,
CloseType: channeldb.BreachClose,
IsPending: true,
ShortChanID: c.cfg.chanState.ShortChanID,
ShortChanID: c.cfg.chanState.ShortChanID(),
}
if err := c.cfg.chanState.CloseChannel(&closeSummary); err != nil {