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
2d09e677
Commit
2d09e677
authored
Dec 18, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to new methods
parent
49e0267f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
9 deletions
+16
-9
block_pool.go
block_pool.go
+1
-1
main.go
cmd/ethereum/main.go
+1
-1
debugger.go
cmd/mist/debugger.go
+1
-1
gui.go
cmd/mist/gui.go
+2
-2
chain_manager.go
core/chain_manager.go
+7
-0
peer.go
peer.go
+2
-2
hexface.go
xeth/hexface.go
+1
-1
pipe.go
xeth/pipe.go
+1
-1
No files found.
block_pool.go
View file @
2d09e677
...
...
@@ -66,7 +66,7 @@ func (self *BlockPool) HasLatestHash() bool {
self
.
mut
.
Lock
()
defer
self
.
mut
.
Unlock
()
return
self
.
pool
[
string
(
self
.
eth
.
ChainManager
()
.
CurrentBlock
.
Hash
())]
!=
nil
return
self
.
pool
[
string
(
self
.
eth
.
ChainManager
()
.
CurrentBlock
()
.
Hash
())]
!=
nil
}
func
(
self
*
BlockPool
)
HasCommonHash
(
hash
[]
byte
)
bool
{
...
...
cmd/ethereum/main.go
View file @
2d09e677
...
...
@@ -77,7 +77,7 @@ func main() {
var
block
*
types
.
Block
if
len
(
DumpHash
)
==
0
&&
DumpNumber
==
-
1
{
block
=
ethereum
.
ChainManager
()
.
CurrentBlock
block
=
ethereum
.
ChainManager
()
.
CurrentBlock
()
}
else
if
len
(
DumpHash
)
>
0
{
block
=
ethereum
.
ChainManager
()
.
GetBlock
(
ethutil
.
Hex2Bytes
(
DumpHash
))
}
else
{
...
...
cmd/mist/debugger.go
View file @
2d09e677
...
...
@@ -149,7 +149,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
self
.
SetAsm
(
script
)
block
:=
self
.
lib
.
eth
.
ChainManager
()
.
CurrentBlock
block
:=
self
.
lib
.
eth
.
ChainManager
()
.
CurrentBlock
()
env
:=
utils
.
NewEnv
(
statedb
,
block
,
account
.
Address
(),
value
)
...
...
cmd/mist/gui.go
View file @
2d09e677
...
...
@@ -246,7 +246,7 @@ func (gui *Gui) CreateAndSetPrivKey() (string, string, string, string) {
}
func
(
gui
*
Gui
)
setInitialChain
(
ancientBlocks
bool
)
{
sBlk
:=
gui
.
eth
.
ChainManager
()
.
LastBlockHash
sBlk
:=
gui
.
eth
.
ChainManager
()
.
LastBlockHash
()
blk
:=
gui
.
eth
.
ChainManager
()
.
GetBlock
(
sBlk
)
for
;
blk
!=
nil
;
blk
=
gui
.
eth
.
ChainManager
()
.
GetBlock
(
sBlk
)
{
sBlk
=
blk
.
PrevHash
...
...
@@ -468,7 +468,7 @@ func (gui *Gui) update() {
case
<-
peerUpdateTicker
.
C
:
gui
.
setPeerInfo
()
case
<-
generalUpdateTicker
.
C
:
statusText
:=
"#"
+
gui
.
eth
.
ChainManager
()
.
CurrentBlock
.
Number
.
String
()
statusText
:=
"#"
+
gui
.
eth
.
ChainManager
()
.
CurrentBlock
()
.
Number
.
String
()
lastBlockLabel
.
Set
(
"text"
,
statusText
)
miningLabel
.
Set
(
"text"
,
"Mining @ "
+
strconv
.
FormatInt
(
gui
.
uiLib
.
miner
.
GetPow
()
.
GetHashrate
(),
10
)
+
"Khash"
)
...
...
core/chain_manager.go
View file @
2d09e677
...
...
@@ -74,6 +74,13 @@ func (self *ChainManager) LastBlockNumber() uint64 {
return
self
.
lastBlockNumber
}
func
(
self
*
ChainManager
)
LastBlockHash
()
[]
byte
{
self
.
mu
.
RLock
()
defer
self
.
mu
.
RUnlock
()
return
self
.
lastBlockHash
}
func
(
self
*
ChainManager
)
CurrentBlock
()
*
types
.
Block
{
self
.
mu
.
RLock
()
defer
self
.
mu
.
RUnlock
()
...
...
peer.go
View file @
2d09e677
...
...
@@ -666,8 +666,8 @@ func (self *Peer) pushStatus() {
msg
:=
wire
.
NewMessage
(
wire
.
MsgStatusTy
,
[]
interface
{}{
uint32
(
ProtocolVersion
),
uint32
(
NetVersion
),
self
.
ethereum
.
ChainManager
()
.
T
D
,
self
.
ethereum
.
ChainManager
()
.
CurrentBlock
.
Hash
(),
self
.
ethereum
.
ChainManager
()
.
T
d
()
,
self
.
ethereum
.
ChainManager
()
.
CurrentBlock
()
.
Hash
(),
self
.
ethereum
.
ChainManager
()
.
Genesis
()
.
Hash
(),
})
...
...
xeth/hexface.go
View file @
2d09e677
...
...
@@ -29,7 +29,7 @@ func (self *JSXEth) BlockByHash(strHash string) *JSBlock {
func
(
self
*
JSXEth
)
BlockByNumber
(
num
int32
)
*
JSBlock
{
if
num
==
-
1
{
return
NewJSBlock
(
self
.
obj
.
ChainManager
()
.
CurrentBlock
)
return
NewJSBlock
(
self
.
obj
.
ChainManager
()
.
CurrentBlock
()
)
}
return
NewJSBlock
(
self
.
obj
.
ChainManager
()
.
GetBlockByNumber
(
uint64
(
num
)))
...
...
xeth/pipe.go
View file @
2d09e677
...
...
@@ -82,7 +82,7 @@ func (self *XEth) Execute(addr []byte, data []byte, value, gas, price *ethutil.V
func
(
self
*
XEth
)
ExecuteObject
(
object
*
Object
,
data
[]
byte
,
value
,
gas
,
price
*
ethutil
.
Value
)
([]
byte
,
error
)
{
var
(
initiator
=
state
.
NewStateObject
(
self
.
obj
.
KeyManager
()
.
KeyPair
()
.
Address
())
block
=
self
.
chainManager
.
CurrentBlock
block
=
self
.
chainManager
.
CurrentBlock
()
)
self
.
Vm
.
State
=
self
.
World
()
.
State
()
.
Copy
()
...
...
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