lntest: restart Alice after on-chain settle
To ensure lnd is able to pick up an on-chain preimage properly after a restart, we suspend Alice and check that the payment is listed correctly as succeeded after a restart.
This commit is contained in:
parent
bb619352be
commit
80ad0fdd5c
@ -195,6 +195,13 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// At this point we suspend Alice to make sure she'll handle the
|
||||||
|
// on-chain settle after a restart.
|
||||||
|
restartAlice, err := net.SuspendNode(net.Alice)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unable to suspend alice: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Mine a block to confirm the two transactions (+ the coinbase).
|
// Mine a block to confirm the two transactions (+ the coinbase).
|
||||||
block = mineBlocks(t, net, 1, 2)[0]
|
block = mineBlocks(t, net, 1, 2)[0]
|
||||||
if len(block.Transactions) != 3 {
|
if len(block.Transactions) != 3 {
|
||||||
@ -285,6 +292,12 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
|
|||||||
bobSecondLevelCSV := uint32(defaultCSV)
|
bobSecondLevelCSV := uint32(defaultCSV)
|
||||||
carolSecondLevelCSV--
|
carolSecondLevelCSV--
|
||||||
|
|
||||||
|
// Now that the preimage from Bob has hit the chain, restart Alice to
|
||||||
|
// ensure she'll pick it up.
|
||||||
|
if err := restartAlice(); err != nil {
|
||||||
|
t.Fatalf("unable to restart alice: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
// If we then mine 3 additional blocks, Carol's second level tx should
|
// If we then mine 3 additional blocks, Carol's second level tx should
|
||||||
// mature, and she can pull the funds from it with a sweep tx.
|
// mature, and she can pull the funds from it with a sweep tx.
|
||||||
if _, err := net.Miner.Node.Generate(carolSecondLevelCSV); err != nil {
|
if _, err := net.Miner.Node.Generate(carolSecondLevelCSV); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user