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
836ed9d6
Commit
836ed9d6
authored
Aug 22, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write Protocol version to the db so we can perform sanity checks
parent
a9f9a594
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
ethereum.go
ethereum.go
+11
-1
value.go
ethutil/value.go
+2
-0
No files found.
ethereum.go
View file @
836ed9d6
...
...
@@ -90,7 +90,6 @@ type Ethereum struct {
}
func
New
(
db
ethutil
.
Database
,
clientIdentity
ethwire
.
ClientIdentity
,
keyManager
*
ethcrypto
.
KeyManager
,
caps
Caps
,
usePnp
bool
)
(
*
Ethereum
,
error
)
{
var
err
error
var
nat
NAT
...
...
@@ -101,6 +100,8 @@ func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager
}
}
bootstrapDb
(
db
)
ethutil
.
Config
.
Db
=
db
nonce
,
_
:=
ethutil
.
RandomUint64
()
...
...
@@ -534,3 +535,12 @@ out:
}
}
}
func
bootstrapDb
(
db
ethutil
.
Database
)
{
d
,
_
:=
db
.
Get
([]
byte
(
"ProtocolVersion"
))
protov
:=
ethutil
.
NewValue
(
d
)
.
Uint
()
if
protov
==
0
{
db
.
Put
([]
byte
(
"ProtocolVersion"
),
ethutil
.
NewValue
(
ProtocolVersion
)
.
Bytes
())
}
}
ethutil/value.go
View file @
836ed9d6
...
...
@@ -141,6 +141,8 @@ func (val *Value) Bytes() []byte {
return
[]
byte
(
s
)
}
else
if
s
,
ok
:=
val
.
Val
.
(
*
big
.
Int
);
ok
{
return
s
.
Bytes
()
}
else
{
return
big
.
NewInt
(
val
.
Int
())
.
Bytes
()
}
return
[]
byte
{}
...
...
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