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:
Johan T. Halseth 2019-06-12 10:44:22 +02:00
parent bb619352be
commit 80ad0fdd5c
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -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).
block = mineBlocks(t, net, 1, 2)[0]
if len(block.Transactions) != 3 {
@ -285,6 +292,12 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
bobSecondLevelCSV := uint32(defaultCSV)
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
// mature, and she can pull the funds from it with a sweep tx.
if _, err := net.Miner.Node.Generate(carolSecondLevelCSV); err != nil {