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
0c4040d1
Commit
0c4040d1
authored
May 20, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
parents
2bd377a3
31e44c2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
18 deletions
+17
-18
state_manager.go
ethchain/state_manager.go
+1
-2
common.go
ethutil/common.go
+13
-13
common_test.go
ethutil/common_test.go
+3
-3
No files found.
ethchain/state_manager.go
View file @
0c4040d1
...
@@ -180,6 +180,7 @@ func (sm *StateManager) ProcessBlock(state *State, block *Block, dontReact bool)
...
@@ -180,6 +180,7 @@ func (sm *StateManager) ProcessBlock(state *State, block *Block, dontReact bool)
// Add the block to the chain
// Add the block to the chain
sm
.
bc
.
Add
(
block
)
sm
.
bc
.
Add
(
block
)
sm
.
notifyChanges
(
state
)
ethutil
.
Config
.
Log
.
Infof
(
"[STATE] Added block #%d (%x)
\n
"
,
block
.
BlockInfo
()
.
Number
,
block
.
Hash
())
ethutil
.
Config
.
Log
.
Infof
(
"[STATE] Added block #%d (%x)
\n
"
,
block
.
BlockInfo
()
.
Number
,
block
.
Hash
())
if
dontReact
==
false
{
if
dontReact
==
false
{
...
@@ -188,8 +189,6 @@ func (sm *StateManager) ProcessBlock(state *State, block *Block, dontReact bool)
...
@@ -188,8 +189,6 @@ func (sm *StateManager) ProcessBlock(state *State, block *Block, dontReact bool)
state
.
manifest
.
Reset
()
state
.
manifest
.
Reset
()
}
}
sm
.
notifyChanges
(
state
)
sm
.
Ethereum
.
Broadcast
(
ethwire
.
MsgBlockTy
,
[]
interface
{}{
block
.
Value
()
.
Val
})
sm
.
Ethereum
.
Broadcast
(
ethwire
.
MsgBlockTy
,
[]
interface
{}{
block
.
Value
()
.
Val
})
sm
.
Ethereum
.
TxPool
()
.
RemoveInvalid
(
state
)
sm
.
Ethereum
.
TxPool
()
.
RemoveInvalid
(
state
)
...
...
ethutil/common.go
View file @
0c4040d1
...
@@ -7,13 +7,13 @@ import (
...
@@ -7,13 +7,13 @@ import (
// The different number of units
// The different number of units
var
(
var
(
Ether
=
BigPow
(
10
,
18
)
Ether
=
BigPow
(
10
,
18
)
Finney
=
BigPow
(
10
,
15
)
Finney
=
BigPow
(
10
,
15
)
Szabo
=
BigPow
(
10
,
12
)
Szabo
=
BigPow
(
10
,
12
)
Vita
=
BigPow
(
10
,
9
)
Shannon
=
BigPow
(
10
,
9
)
Turing
=
BigPow
(
10
,
6
)
Babbage
=
BigPow
(
10
,
6
)
Eins
=
BigPow
(
10
,
3
)
Ada
=
BigPow
(
10
,
3
)
Wei
=
big
.
NewInt
(
1
)
Wei
=
big
.
NewInt
(
1
)
)
)
// Currency to string
// Currency to string
...
@@ -27,12 +27,12 @@ func CurrencyToString(num *big.Int) string {
...
@@ -27,12 +27,12 @@ func CurrencyToString(num *big.Int) string {
return
fmt
.
Sprintf
(
"%v Finney"
,
new
(
big
.
Int
)
.
Div
(
num
,
Finney
))
return
fmt
.
Sprintf
(
"%v Finney"
,
new
(
big
.
Int
)
.
Div
(
num
,
Finney
))
case
num
.
Cmp
(
Szabo
)
>=
0
:
case
num
.
Cmp
(
Szabo
)
>=
0
:
return
fmt
.
Sprintf
(
"%v Szabo"
,
new
(
big
.
Int
)
.
Div
(
num
,
Szabo
))
return
fmt
.
Sprintf
(
"%v Szabo"
,
new
(
big
.
Int
)
.
Div
(
num
,
Szabo
))
case
num
.
Cmp
(
Vita
)
>=
0
:
case
num
.
Cmp
(
Shannon
)
>=
0
:
return
fmt
.
Sprintf
(
"%v
Vita"
,
new
(
big
.
Int
)
.
Div
(
num
,
Vita
))
return
fmt
.
Sprintf
(
"%v
Shannon"
,
new
(
big
.
Int
)
.
Div
(
num
,
Shannon
))
case
num
.
Cmp
(
Turing
)
>=
0
:
case
num
.
Cmp
(
Babbage
)
>=
0
:
return
fmt
.
Sprintf
(
"%v
Turing"
,
new
(
big
.
Int
)
.
Div
(
num
,
Turing
))
return
fmt
.
Sprintf
(
"%v
Babbage"
,
new
(
big
.
Int
)
.
Div
(
num
,
Babbage
))
case
num
.
Cmp
(
Eins
)
>=
0
:
case
num
.
Cmp
(
Ada
)
>=
0
:
return
fmt
.
Sprintf
(
"%v
Eins"
,
new
(
big
.
Int
)
.
Div
(
num
,
Eins
))
return
fmt
.
Sprintf
(
"%v
Ada"
,
new
(
big
.
Int
)
.
Div
(
num
,
Ada
))
}
}
return
fmt
.
Sprintf
(
"%v Wei"
,
num
)
return
fmt
.
Sprintf
(
"%v Wei"
,
num
)
...
...
ethutil/common_test.go
View file @
0c4040d1
...
@@ -26,15 +26,15 @@ func TestCommon(t *testing.T) {
...
@@ -26,15 +26,15 @@ func TestCommon(t *testing.T) {
t
.
Error
(
"Got"
,
szabo
)
t
.
Error
(
"Got"
,
szabo
)
}
}
if
vito
!=
"10
Vita
"
{
if
vito
!=
"10
Shannon
"
{
t
.
Error
(
"Got"
,
vito
)
t
.
Error
(
"Got"
,
vito
)
}
}
if
turing
!=
"10
Turing
"
{
if
turing
!=
"10
Babbage
"
{
t
.
Error
(
"Got"
,
turing
)
t
.
Error
(
"Got"
,
turing
)
}
}
if
eins
!=
"10
Eins
"
{
if
eins
!=
"10
Ada
"
{
t
.
Error
(
"Got"
,
eins
)
t
.
Error
(
"Got"
,
eins
)
}
}
...
...
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