good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
5d89bbdd
Commit
5d89bbdd
authored
Nov 4, 2015
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
eth: fix error casting regression during database open
parent
e165c2d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
eth/backend.go
+3
-18
3 additions, 18 deletions
eth/backend.go
with
3 additions
and
18 deletions
eth/backend.go
+
3
−
18
View file @
5d89bbdd
...
@@ -65,7 +65,7 @@ const (
...
@@ -65,7 +65,7 @@ const (
var
(
var
(
jsonlogger
=
logger
.
NewJsonLogger
()
jsonlogger
=
logger
.
NewJsonLogger
()
datadirInUseErr
N
os
=
[]
uint
{
11
,
32
,
35
}
datadirInUseErr
n
os
=
map
[
uint
]
bool
{
11
:
true
,
32
:
true
,
35
:
true
}
portInUseErrRE
=
regexp
.
MustCompile
(
"address already in use"
)
portInUseErrRE
=
regexp
.
MustCompile
(
"address already in use"
)
defaultBootNodes
=
[]
*
discover
.
Node
{
defaultBootNodes
=
[]
*
discover
.
Node
{
...
@@ -286,15 +286,7 @@ func New(config *Config) (*Ethereum, error) {
...
@@ -286,15 +286,7 @@ func New(config *Config) (*Ethereum, error) {
// Open the chain database and perform any upgrades needed
// Open the chain database and perform any upgrades needed
chainDb
,
err
:=
newdb
(
filepath
.
Join
(
config
.
DataDir
,
"chaindata"
))
chainDb
,
err
:=
newdb
(
filepath
.
Join
(
config
.
DataDir
,
"chaindata"
))
if
err
!=
nil
{
if
err
!=
nil
{
var
ok
bool
if
errno
,
ok
:=
err
.
(
syscall
.
Errno
);
ok
&&
datadirInUseErrnos
[
uint
(
errno
)]
{
errno
:=
uint
(
err
.
(
syscall
.
Errno
))
for
_
,
no
:=
range
datadirInUseErrNos
{
if
errno
==
no
{
ok
=
true
break
}
}
if
ok
{
err
=
fmt
.
Errorf
(
"%v (check if another instance of geth is already running with the same data directory '%s')"
,
err
,
config
.
DataDir
)
err
=
fmt
.
Errorf
(
"%v (check if another instance of geth is already running with the same data directory '%s')"
,
err
,
config
.
DataDir
)
}
}
return
nil
,
fmt
.
Errorf
(
"blockchain db err: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"blockchain db err: %v"
,
err
)
...
@@ -311,14 +303,7 @@ func New(config *Config) (*Ethereum, error) {
...
@@ -311,14 +303,7 @@ func New(config *Config) (*Ethereum, error) {
dappDb
,
err
:=
newdb
(
filepath
.
Join
(
config
.
DataDir
,
"dapp"
))
dappDb
,
err
:=
newdb
(
filepath
.
Join
(
config
.
DataDir
,
"dapp"
))
if
err
!=
nil
{
if
err
!=
nil
{
var
ok
bool
if
errno
,
ok
:=
err
.
(
syscall
.
Errno
);
ok
&&
datadirInUseErrnos
[
uint
(
errno
)]
{
for
_
,
no
:=
range
datadirInUseErrNos
{
if
uint
(
err
.
(
syscall
.
Errno
))
==
no
{
ok
=
true
break
}
}
if
ok
{
err
=
fmt
.
Errorf
(
"%v (check if another instance of geth is already running with the same data directory '%s')"
,
err
,
config
.
DataDir
)
err
=
fmt
.
Errorf
(
"%v (check if another instance of geth is already running with the same data directory '%s')"
,
err
,
config
.
DataDir
)
}
}
return
nil
,
fmt
.
Errorf
(
"dapp db err: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"dapp db err: %v"
,
err
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment