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
b25126a2
Commit
b25126a2
authored
Jan 08, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixed and additions for block proc
* Path check length * Genesis include TD * Output TD on last block
parent
db4aaedc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
4 deletions
+5
-4
chain_manager.go
core/chain_manager.go
+2
-2
genesis.go
core/genesis.go
+1
-0
path.go
ethutil/path.go
+1
-1
rlp.go
ethutil/rlp.go
+1
-1
No files found.
core/chain_manager.go
View file @
b25126a2
...
...
@@ -139,7 +139,7 @@ func (bc *ChainManager) setLastBlock() {
bc
.
Reset
()
}
chainlogger
.
Infof
(
"Last block (#%d) %x
\n
"
,
bc
.
lastBlockNumber
,
bc
.
currentBlock
.
Hash
()
)
chainlogger
.
Infof
(
"Last block (#%d) %x
TD=%v
\n
"
,
bc
.
lastBlockNumber
,
bc
.
currentBlock
.
Hash
(),
bc
.
td
)
}
// Block creation & chain handling
...
...
@@ -215,7 +215,7 @@ func (bc *ChainManager) insert(block *types.Block) {
func
(
bc
*
ChainManager
)
write
(
block
*
types
.
Block
)
{
bc
.
writeBlockInfo
(
block
)
encodedBlock
:=
ethutil
.
Encode
(
block
)
encodedBlock
:=
ethutil
.
Encode
(
block
.
RlpDataForStorage
()
)
bc
.
db
.
Put
(
block
.
Hash
(),
encodedBlock
)
}
...
...
core/genesis.go
View file @
b25126a2
...
...
@@ -25,6 +25,7 @@ func GenesisBlock(db ethutil.Database) *types.Block {
genesis
.
Header
()
.
GasLimit
=
big
.
NewInt
(
1000000
)
genesis
.
Header
()
.
GasUsed
=
ethutil
.
Big0
genesis
.
Header
()
.
Time
=
0
genesis
.
Td
=
ethutil
.
Big0
genesis
.
SetUncles
([]
*
types
.
Header
{})
genesis
.
SetTransactions
(
types
.
Transactions
{})
...
...
ethutil/path.go
View file @
b25126a2
...
...
@@ -12,7 +12,7 @@ func ExpandHomePath(p string) (path string) {
path
=
p
// Check in case of paths like "/something/~/something/"
if
path
[
:
2
]
==
"~/"
{
if
len
(
path
)
>
1
&&
path
[
:
2
]
==
"~/"
{
usr
,
_
:=
user
.
Current
()
dir
:=
usr
.
HomeDir
...
...
ethutil/rlp.go
View file @
b25126a2
...
...
@@ -137,7 +137,7 @@ func Encode(object interface{}) []byte {
case
byte
:
buff
.
Write
(
Encode
(
big
.
NewInt
(
int64
(
t
))))
case
*
big
.
Int
:
// Not sure how this is possible while we check for
// Not sure how this is possible while we check for
nil
if
t
==
nil
{
buff
.
WriteByte
(
0xc0
)
}
else
{
...
...
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