mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
accounts/keystore: fix formatting nits
This commit is contained in:
parent
794564046f
commit
e798e8ff18
2 changed files with 3 additions and 14 deletions
|
|
@ -36,23 +36,18 @@ type fileCache struct {
|
|||
}
|
||||
|
||||
func (fc *fileCache) checkFile(path string) (created, deleted, updated bool, err error) {
|
||||
|
||||
fc.mu.Lock()
|
||||
defer fc.mu.Unlock()
|
||||
|
||||
created, deleted, updated, err = false, false, false, nil
|
||||
|
||||
previouslyKnown := fc.all.Has(path)
|
||||
|
||||
fi, err := os.Lstat(path)
|
||||
|
||||
if err != nil {
|
||||
//A file has been deleted, but it can be a file which we
|
||||
// A file has been deleted, but it can be a file which we
|
||||
// were not previously watching.
|
||||
deleted = previouslyKnown && os.IsNotExist(err)
|
||||
return created, deleted, updated, err
|
||||
}
|
||||
|
||||
if skipKeyFile(fi) {
|
||||
log.Trace("Ignoring file on account scan", "path", path)
|
||||
return created, deleted, updated, err
|
||||
|
|
@ -60,7 +55,6 @@ func (fc *fileCache) checkFile(path string) (created, deleted, updated bool, err
|
|||
|
||||
created = !previouslyKnown
|
||||
updated = previouslyKnown
|
||||
|
||||
return created, deleted, updated, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,14 +20,13 @@ import (
|
|||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"path/filepath"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/event"
|
||||
|
|
@ -377,11 +376,7 @@ func checkEvents(t *testing.T, want []walletEvent, have []walletEvent) {
|
|||
}
|
||||
|
||||
func tmpKeyStore(t *testing.T, encrypted bool) (string, *KeyStore) {
|
||||
var (
|
||||
d string
|
||||
err error
|
||||
)
|
||||
d, err = ioutil.TempDir("", "eth-keystore-test")
|
||||
d, err := ioutil.TempDir("", "eth-keystore-test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue