mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 06:35:07 +01:00
contractcourt+itest: make sure ChannelArbitrator has the latest htlcs
This commit is contained in:
parent
71ee50f87c
commit
e45db07a10
3 changed files with 7 additions and 6 deletions
|
@ -1287,6 +1287,10 @@ func (c *ChainArbitrator) FindOutgoingHTLCDeadline(scid lnwire.ShortChannelID,
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure the channel arbitrator has the latest view of its
|
||||||
|
// active HTLCs.
|
||||||
|
channelArb.updateActiveHTLCs()
|
||||||
|
|
||||||
// Iterate all the known HTLCs to find the targeted incoming
|
// Iterate all the known HTLCs to find the targeted incoming
|
||||||
// HTLC.
|
// HTLC.
|
||||||
for _, htlcs := range channelArb.activeHTLCs {
|
for _, htlcs := range channelArb.activeHTLCs {
|
||||||
|
|
|
@ -3089,6 +3089,9 @@ func (c *ChannelArbitrator) channelAttendant(bestHeight int32) {
|
||||||
// We've just received a request to forcibly close out the
|
// We've just received a request to forcibly close out the
|
||||||
// channel. We'll
|
// channel. We'll
|
||||||
case closeReq := <-c.forceCloseReqs:
|
case closeReq := <-c.forceCloseReqs:
|
||||||
|
log.Infof("ChannelArbitrator(%v): received force "+
|
||||||
|
"close request", c.cfg.ChanPoint)
|
||||||
|
|
||||||
if c.state != StateDefault {
|
if c.state != StateDefault {
|
||||||
select {
|
select {
|
||||||
case closeReq.closeTx <- nil:
|
case closeReq.closeTx <- nil:
|
||||||
|
|
|
@ -713,12 +713,6 @@ func runMultiHopLocalForceCloseOnChainHtlcTimeout(ht *lntest.HarnessTest,
|
||||||
// to be mined to trigger a force close later on.
|
// to be mined to trigger a force close later on.
|
||||||
var blocksMined uint32
|
var blocksMined uint32
|
||||||
|
|
||||||
// We need to mine a block otherwise `FindOutgoingHTLCDeadline` cannot
|
|
||||||
// find the incoming HTLC on Bob's ChainArbitrator.
|
|
||||||
//
|
|
||||||
// TODO(yy): Investigate and fix it!
|
|
||||||
ht.MineEmptyBlocks(1)
|
|
||||||
|
|
||||||
// Now that all parties have the HTLC locked in, we'll immediately
|
// Now that all parties have the HTLC locked in, we'll immediately
|
||||||
// force close the Bob -> Carol channel. This should trigger contract
|
// force close the Bob -> Carol channel. This should trigger contract
|
||||||
// resolution mode for both of them.
|
// resolution mode for both of them.
|
||||||
|
|
Loading…
Add table
Reference in a new issue