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
6ea44c46
Commit
6ea44c46
authored
Oct 20, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to reflect BlockChain changes
parent
82a2e4fe
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
+17
-17
main.go
ethereum/main.go
+3
-3
javascript_runtime.go
javascript/javascript_runtime.go
+2
-2
bindings.go
mist/bindings.go
+2
-2
debugger.go
mist/debugger.go
+1
-1
gui.go
mist/gui.go
+6
-6
cmd.go
utils/cmd.go
+3
-3
No files found.
ethereum/main.go
View file @
6ea44c46
...
@@ -60,11 +60,11 @@ func main() {
...
@@ -60,11 +60,11 @@ func main() {
var
block
*
ethchain
.
Block
var
block
*
ethchain
.
Block
if
len
(
DumpHash
)
==
0
&&
DumpNumber
==
-
1
{
if
len
(
DumpHash
)
==
0
&&
DumpNumber
==
-
1
{
block
=
ethereum
.
BlockChain
()
.
CurrentBlock
block
=
ethereum
.
ChainManager
()
.
CurrentBlock
}
else
if
len
(
DumpHash
)
>
0
{
}
else
if
len
(
DumpHash
)
>
0
{
block
=
ethereum
.
BlockChain
()
.
GetBlock
(
ethutil
.
Hex2Bytes
(
DumpHash
))
block
=
ethereum
.
ChainManager
()
.
GetBlock
(
ethutil
.
Hex2Bytes
(
DumpHash
))
}
else
{
}
else
{
block
=
ethereum
.
BlockChain
()
.
GetBlockByNumber
(
uint64
(
DumpNumber
))
block
=
ethereum
.
ChainManager
()
.
GetBlockByNumber
(
uint64
(
DumpNumber
))
}
}
if
block
==
nil
{
if
block
==
nil
{
...
...
javascript/javascript_runtime.go
View file @
6ea44c46
...
@@ -139,10 +139,10 @@ func (self *JSRE) dump(call otto.FunctionCall) otto.Value {
...
@@ -139,10 +139,10 @@ func (self *JSRE) dump(call otto.FunctionCall) otto.Value {
var
block
*
ethchain
.
Block
var
block
*
ethchain
.
Block
if
call
.
Argument
(
0
)
.
IsNumber
()
{
if
call
.
Argument
(
0
)
.
IsNumber
()
{
num
,
_
:=
call
.
Argument
(
0
)
.
ToInteger
()
num
,
_
:=
call
.
Argument
(
0
)
.
ToInteger
()
block
=
self
.
ethereum
.
BlockChain
()
.
GetBlockByNumber
(
uint64
(
num
))
block
=
self
.
ethereum
.
ChainManager
()
.
GetBlockByNumber
(
uint64
(
num
))
}
else
if
call
.
Argument
(
0
)
.
IsString
()
{
}
else
if
call
.
Argument
(
0
)
.
IsString
()
{
hash
,
_
:=
call
.
Argument
(
0
)
.
ToString
()
hash
,
_
:=
call
.
Argument
(
0
)
.
ToString
()
block
=
self
.
ethereum
.
BlockChain
()
.
GetBlock
(
ethutil
.
Hex2Bytes
(
hash
))
block
=
self
.
ethereum
.
ChainManager
()
.
GetBlock
(
ethutil
.
Hex2Bytes
(
hash
))
}
else
{
}
else
{
fmt
.
Println
(
"invalid argument for dump. Either hex string or number"
)
fmt
.
Println
(
"invalid argument for dump. Either hex string or number"
)
}
}
...
...
mist/bindings.go
View file @
6ea44c46
...
@@ -96,9 +96,9 @@ func (self *Gui) DumpState(hash, path string) {
...
@@ -96,9 +96,9 @@ func (self *Gui) DumpState(hash, path string) {
var
block
*
ethchain
.
Block
var
block
*
ethchain
.
Block
if
hash
[
0
]
==
'#'
{
if
hash
[
0
]
==
'#'
{
i
,
_
:=
strconv
.
Atoi
(
hash
[
1
:
])
i
,
_
:=
strconv
.
Atoi
(
hash
[
1
:
])
block
=
self
.
eth
.
BlockChain
()
.
GetBlockByNumber
(
uint64
(
i
))
block
=
self
.
eth
.
ChainManager
()
.
GetBlockByNumber
(
uint64
(
i
))
}
else
{
}
else
{
block
=
self
.
eth
.
BlockChain
()
.
GetBlock
(
ethutil
.
Hex2Bytes
(
hash
))
block
=
self
.
eth
.
ChainManager
()
.
GetBlock
(
ethutil
.
Hex2Bytes
(
hash
))
}
}
if
block
==
nil
{
if
block
==
nil
{
...
...
mist/debugger.go
View file @
6ea44c46
...
@@ -131,7 +131,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
...
@@ -131,7 +131,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
self
.
SetAsm
(
script
)
self
.
SetAsm
(
script
)
block
:=
self
.
lib
.
eth
.
BlockChain
()
.
CurrentBlock
block
:=
self
.
lib
.
eth
.
ChainManager
()
.
CurrentBlock
callerClosure
:=
vm
.
NewClosure
(
&
ethstate
.
Message
{},
account
,
contract
,
script
,
gas
,
gasPrice
)
callerClosure
:=
vm
.
NewClosure
(
&
ethstate
.
Message
{},
account
,
contract
,
script
,
gas
,
gasPrice
)
env
:=
utils
.
NewEnv
(
state
,
block
,
account
.
Address
(),
value
)
env
:=
utils
.
NewEnv
(
state
,
block
,
account
.
Address
(),
value
)
...
...
mist/gui.go
View file @
6ea44c46
...
@@ -228,10 +228,10 @@ func (gui *Gui) CreateAndSetPrivKey() (string, string, string, string) {
...
@@ -228,10 +228,10 @@ func (gui *Gui) CreateAndSetPrivKey() (string, string, string, string) {
return
gui
.
eth
.
KeyManager
()
.
KeyPair
()
.
AsStrings
()
return
gui
.
eth
.
KeyManager
()
.
KeyPair
()
.
AsStrings
()
}
}
func
(
gui
*
Gui
)
setInitial
BlockChain
()
{
func
(
gui
*
Gui
)
setInitial
ChainManager
()
{
sBlk
:=
gui
.
eth
.
BlockChain
()
.
LastBlockHash
sBlk
:=
gui
.
eth
.
ChainManager
()
.
LastBlockHash
blk
:=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
blk
:=
gui
.
eth
.
ChainManager
()
.
GetBlock
(
sBlk
)
for
;
blk
!=
nil
;
blk
=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
{
for
;
blk
!=
nil
;
blk
=
gui
.
eth
.
ChainManager
()
.
GetBlock
(
sBlk
)
{
sBlk
=
blk
.
PrevHash
sBlk
=
blk
.
PrevHash
addr
:=
gui
.
address
()
addr
:=
gui
.
address
()
...
@@ -363,7 +363,7 @@ func (gui *Gui) update() {
...
@@ -363,7 +363,7 @@ func (gui *Gui) update() {
}
}
go
func
()
{
go
func
()
{
go
gui
.
setInitial
BlockChain
()
go
gui
.
setInitial
ChainManager
()
gui
.
loadAddressBook
()
gui
.
loadAddressBook
()
gui
.
setPeerInfo
()
gui
.
setPeerInfo
()
gui
.
readPreviousTransactions
()
gui
.
readPreviousTransactions
()
...
@@ -464,7 +464,7 @@ func (gui *Gui) update() {
...
@@ -464,7 +464,7 @@ func (gui *Gui) update() {
case
<-
peerUpdateTicker
.
C
:
case
<-
peerUpdateTicker
.
C
:
gui
.
setPeerInfo
()
gui
.
setPeerInfo
()
case
<-
generalUpdateTicker
.
C
:
case
<-
generalUpdateTicker
.
C
:
statusText
:=
"#"
+
gui
.
eth
.
BlockChain
()
.
CurrentBlock
.
Number
.
String
()
statusText
:=
"#"
+
gui
.
eth
.
ChainManager
()
.
CurrentBlock
.
Number
.
String
()
lastBlockLabel
.
Set
(
"text"
,
statusText
)
lastBlockLabel
.
Set
(
"text"
,
statusText
)
if
gui
.
miner
!=
nil
{
if
gui
.
miner
!=
nil
{
...
...
utils/cmd.go
View file @
6ea44c46
...
@@ -169,7 +169,7 @@ func StartEthereum(ethereum *eth.Ethereum, UseSeed bool) {
...
@@ -169,7 +169,7 @@ func StartEthereum(ethereum *eth.Ethereum, UseSeed bool) {
}
}
func
ShowGenesis
(
ethereum
*
eth
.
Ethereum
)
{
func
ShowGenesis
(
ethereum
*
eth
.
Ethereum
)
{
logger
.
Infoln
(
ethereum
.
BlockChain
()
.
Genesis
())
logger
.
Infoln
(
ethereum
.
ChainManager
()
.
Genesis
())
exit
(
nil
)
exit
(
nil
)
}
}
...
@@ -310,12 +310,12 @@ func StopMining(ethereum *eth.Ethereum) bool {
...
@@ -310,12 +310,12 @@ func StopMining(ethereum *eth.Ethereum) bool {
// Replay block
// Replay block
func
BlockDo
(
ethereum
*
eth
.
Ethereum
,
hash
[]
byte
)
error
{
func
BlockDo
(
ethereum
*
eth
.
Ethereum
,
hash
[]
byte
)
error
{
block
:=
ethereum
.
BlockChain
()
.
GetBlock
(
hash
)
block
:=
ethereum
.
ChainManager
()
.
GetBlock
(
hash
)
if
block
==
nil
{
if
block
==
nil
{
return
fmt
.
Errorf
(
"unknown block %x"
,
hash
)
return
fmt
.
Errorf
(
"unknown block %x"
,
hash
)
}
}
parent
:=
ethereum
.
BlockChain
()
.
GetBlock
(
block
.
PrevHash
)
parent
:=
ethereum
.
ChainManager
()
.
GetBlock
(
block
.
PrevHash
)
_
,
err
:=
ethereum
.
StateManager
()
.
ApplyDiff
(
parent
.
State
(),
parent
,
block
)
_
,
err
:=
ethereum
.
StateManager
()
.
ApplyDiff
(
parent
.
State
(),
parent
,
block
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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