From 9b893d46371a6181e97a5f51ed97ff44da9f243e Mon Sep 17 00:00:00 2001 From: Parham Saremi Date: Mon, 7 Nov 2022 17:22:28 +0330 Subject: [PATCH] Frontend.Console: ask confirmation from funder Previously we only asked the funder to press a key to continue the process. But now we ask the funder to state if he wants to continue or not. --- src/GWallet.Frontend.Console/LayerTwo.fs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/GWallet.Frontend.Console/LayerTwo.fs b/src/GWallet.Frontend.Console/LayerTwo.fs index 3405cd153..af6881e35 100644 --- a/src/GWallet.Frontend.Console/LayerTwo.fs +++ b/src/GWallet.Frontend.Console/LayerTwo.fs @@ -563,8 +563,7 @@ module LayerTwo = if channelInfo.IsFunder then Console.WriteLine "Ensure the fundee is ready to accept a connection to lock the funding, \ - then press any key to continue." - Console.ReadKey true |> ignore + Do you want to continue (Y/N):" let tryLock password = async { let nodeClient = Lightning.Connection.StartClient channelStore password @@ -573,7 +572,16 @@ module LayerTwo = return! lockChannelInternal (Node.Client nodeClient) sublockFundingAsync } - UserInteraction.TryWithPasswordAsync tryLock + let confirmation = Console.ReadLine() + if confirmation <> "Y" then + async { + return seq { + yield! UserInteraction.DisplayLightningChannelStatus channelInfo + yield " funder didn't confirm to lock the funding!" + } + } + else + UserInteraction.TryWithPasswordAsync tryLock else let nodeServerType = match channelInfo.NodeTransportType with