diff --git a/LNUnit.Tests/AbcLightningFixture.cs b/LNUnit.Tests/AbcLightningFixture.cs index a982309..ddcc519 100644 --- a/LNUnit.Tests/AbcLightningFixture.cs +++ b/LNUnit.Tests/AbcLightningFixture.cs @@ -635,8 +635,9 @@ public async Task SendMany_Onchain() alice.LightningClient.SendMany(sendManyRequest); - Builder.NewBlock(10); //fast forward in time + await Builder.NewBlock(10); //fast forward in time + await Builder.WaitUntilSyncedToChain("alice"); //verify last address got funds var unspend = alice.LightningClient.ListUnspent(new ListUnspentRequest() { }); var confirmedAddresses = new List(); diff --git a/LNUnit/Setup/LNUnitBuilder.cs b/LNUnit/Setup/LNUnitBuilder.cs index b2b4397..186f828 100644 --- a/LNUnit/Setup/LNUnitBuilder.cs +++ b/LNUnit/Setup/LNUnitBuilder.cs @@ -406,7 +406,7 @@ await GetTarStreamFromFS(n.DockerContainerId, IsBuilt = true; } - private static async Task WaitUntilSyncedToChain(LNDNodeConnection node) + public static async Task WaitUntilSyncedToChain(LNDNodeConnection node) { var info = new GetInfoResponse(); while (!info.SyncedToChain) @@ -416,6 +416,10 @@ private static async Task WaitUntilSyncedToChain(LNDNodeConnection node) } } + public async Task WaitUntilSyncedToChain(string alias) + { + await WaitUntilSyncedToChain(await GetNodeFromAlias(alias)); + } public async Task GetLNDSettingsFromContainer(string containerId, string lndRoot = "/home/lnd/.lnd") { @@ -642,7 +646,8 @@ public async Task RestartByAlias(string alias, uint waitBeforeKillSeconds = 1, b c.ChannelPoint = channelPoint; //Move things along so it is confirmed await BitcoinRpcClient.GenerateAsync(10); - + await this.WaitUntilSyncedToChain(alias); + await this.WaitGraphReady(alias, this.LNDNodePool.TotalNodes); //Set fees & htlcs, TLD var policyUpdateResponse = await node.LightningClient.UpdateChannelPolicyAsync( new PolicyUpdateRequest