Skip to content

Commit

Permalink
Frontend.Console: ask confirmation from funder
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
parhamsaremi committed Nov 7, 2022
1 parent d51d215 commit 9b893d4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/GWallet.Frontend.Console/LayerTwo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9b893d4

Please sign in to comment.