mirror of
https://github.com/status-im/status-keycard-go.git
synced 2025-01-31 00:28:40 +00:00
add 500ms sleep on card unreadable
This commit is contained in:
parent
c7e12eb6ce
commit
3fd18f5ff1
@ -3,6 +3,7 @@ package statuskeycardgo
|
||||
import (
|
||||
"crypto/sha512"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/ebfe/scard"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
@ -111,6 +112,7 @@ func (kc *keycardContext) run() {
|
||||
// error connecting to card
|
||||
l(err.Error())
|
||||
kc.runErr = err
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
close(kc.connected)
|
||||
_ = kc.cardCtx.Release()
|
||||
return
|
||||
@ -118,7 +120,9 @@ func (kc *keycardContext) run() {
|
||||
|
||||
status, err := card.Status()
|
||||
if err != nil {
|
||||
l(err.Error())
|
||||
kc.runErr = err
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
close(kc.connected)
|
||||
_ = kc.cardCtx.Release()
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user