feat: lock the wallet 300 seconds after the last action
This commit is contained in:
parent
d6e7bbba2b
commit
b5189c1762
1 changed files with 12 additions and 5 deletions
17
gpm/cli.go
17
gpm/cli.go
|
@ -364,6 +364,8 @@ func (c *Cli) ListEntries(ch chan<- bool) {
|
||||||
clipboard.WriteAll(code)
|
clipboard.WriteAll(code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ch <- false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,11 +454,16 @@ func Run() {
|
||||||
} else {
|
} else {
|
||||||
c1 := make(chan bool)
|
c1 := make(chan bool)
|
||||||
go c.ListEntries(c1)
|
go c.ListEntries(c1)
|
||||||
select {
|
|
||||||
case <-c1:
|
for {
|
||||||
return
|
select {
|
||||||
case <-time.After(300 * time.Second):
|
case res := <-c1:
|
||||||
return
|
if res {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
case <-time.After(300 * time.Second):
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue