Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
5a584c21
Unverified
Commit
5a584c21
authored
Apr 27, 2022
by
s7v7nislands
Committed by
GitHub
Apr 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: use common.FileExist for checking file existence (#24748)
parent
c3a5054c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
7 deletions
+8
-7
ci.go
build/ci.go
+3
-2
consolecmd.go
cmd/geth/consolecmd.go
+2
-2
flags.go
cmd/utils/flags.go
+1
-1
pruner.go
core/state/pruner/pruner.go
+1
-1
tx_journal.go
core/tx_journal.go
+1
-1
No files found.
build/ci.go
View file @
5a584c21
...
...
@@ -59,6 +59,7 @@ import (
"time"
"github.com/cespare/cp"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto/signify"
"github.com/ethereum/go-ethereum/internal/build"
"github.com/ethereum/go-ethereum/params"
...
...
@@ -163,7 +164,7 @@ func executablePath(name string) string {
func
main
()
{
log
.
SetFlags
(
log
.
Lshortfile
)
if
_
,
err
:=
os
.
Stat
(
filepath
.
Join
(
"build"
,
"ci.go"
));
os
.
IsNotExist
(
err
)
{
if
!
common
.
FileExist
(
filepath
.
Join
(
"build"
,
"ci.go"
)
)
{
log
.
Fatal
(
"this script must be run from the root of the repository"
)
}
if
len
(
os
.
Args
)
<
2
{
...
...
@@ -733,7 +734,7 @@ func ppaUpload(workdir, ppa, sshUser string, files []string) {
var
idfile
string
if
sshkey
:=
getenvBase64
(
"PPA_SSH_KEY"
);
len
(
sshkey
)
>
0
{
idfile
=
filepath
.
Join
(
workdir
,
"sshkey"
)
if
_
,
err
:=
os
.
Stat
(
idfile
);
os
.
IsNotExist
(
err
)
{
if
!
common
.
FileExist
(
idfile
)
{
ioutil
.
WriteFile
(
idfile
,
sshkey
,
0600
)
}
}
...
...
cmd/geth/consolecmd.go
View file @
5a584c21
...
...
@@ -18,11 +18,11 @@ package main
import
(
"fmt"
"os"
"path/filepath"
"strings"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/console"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/rpc"
...
...
@@ -130,7 +130,7 @@ func remoteConsole(ctx *cli.Context) error {
// Maintain compatibility with older Geth configurations storing the
// Ropsten database in `testnet` instead of `ropsten`.
legacyPath
:=
filepath
.
Join
(
path
,
"testnet"
)
if
_
,
err
:=
os
.
Stat
(
legacyPath
);
!
os
.
IsNotExist
(
err
)
{
if
common
.
FileExist
(
legacyPath
)
{
path
=
legacyPath
}
else
{
path
=
filepath
.
Join
(
path
,
"ropsten"
)
...
...
cmd/utils/flags.go
View file @
5a584c21
...
...
@@ -1337,7 +1337,7 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
// Maintain compatibility with older Geth configurations storing the
// Ropsten database in `testnet` instead of `ropsten`.
legacyPath
:=
filepath
.
Join
(
node
.
DefaultDataDir
(),
"testnet"
)
if
_
,
err
:=
os
.
Stat
(
legacyPath
);
!
os
.
IsNotExist
(
err
)
{
if
common
.
FileExist
(
legacyPath
)
{
log
.
Warn
(
"Using the deprecated `testnet` datadir. Future versions will store the Ropsten chain in `ropsten`."
)
cfg
.
DataDir
=
legacyPath
}
else
{
...
...
core/state/pruner/pruner.go
View file @
5a584c21
...
...
@@ -497,7 +497,7 @@ Check the command description "geth snapshot prune-state --help" for more detail
`
func
deleteCleanTrieCache
(
path
string
)
{
if
_
,
err
:=
os
.
Stat
(
path
);
os
.
IsNotExist
(
err
)
{
if
!
common
.
FileExist
(
path
)
{
log
.
Warn
(
warningLog
)
return
}
...
...
core/tx_journal.go
View file @
5a584c21
...
...
@@ -58,7 +58,7 @@ func newTxJournal(path string) *txJournal {
// the specified pool.
func
(
journal
*
txJournal
)
load
(
add
func
([]
*
types
.
Transaction
)
[]
error
)
error
{
// Skip the parsing if the journal file doesn't exist at all
if
_
,
err
:=
os
.
Stat
(
journal
.
path
);
os
.
IsNotExist
(
err
)
{
if
!
common
.
FileExist
(
journal
.
path
)
{
return
nil
}
// Open the journal for loading any past transactions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment