From b5189c17621f112a7294aaddc2e2cfae2f4dbcb6 Mon Sep 17 00:00:00 2001 From: Adrien Waksberg Date: Mon, 21 Oct 2019 21:42:24 +0200 Subject: [PATCH] feat: lock the wallet 300 seconds after the last action --- gpm/cli.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gpm/cli.go b/gpm/cli.go index 03ae0fb..b56895b 100644 --- a/gpm/cli.go +++ b/gpm/cli.go @@ -364,6 +364,8 @@ func (c *Cli) ListEntries(ch chan<- bool) { clipboard.WriteAll(code) } } + + ch <- false } } @@ -452,11 +454,16 @@ func Run() { } else { c1 := make(chan bool) go c.ListEntries(c1) - select { - case <-c1: - return - case <-time.After(300 * time.Second): - return + + for { + select { + case res := <-c1: + if res { + return + } + case <-time.After(300 * time.Second): + return + } } } }