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
5ebae82e
Commit
5ebae82e
authored
Dec 02, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional logging and removed temp merged mining options.
parent
99481a24
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
8 deletions
+6
-8
block_manager.go
chain/block_manager.go
+1
-5
chain_manager.go
chain/chain_manager.go
+1
-1
error.go
chain/error.go
+2
-2
miner.qml
cmd/mist/assets/qml/views/miner.qml
+2
-0
No files found.
chain/block_manager.go
View file @
5ebae82e
...
@@ -185,8 +185,7 @@ func (sm *BlockManager) Process(block *Block) (td *big.Int, msgs state.Messages,
...
@@ -185,8 +185,7 @@ func (sm *BlockManager) Process(block *Block) (td *big.Int, msgs state.Messages,
defer
sm
.
mutex
.
Unlock
()
defer
sm
.
mutex
.
Unlock
()
if
sm
.
bc
.
HasBlock
(
block
.
Hash
())
{
if
sm
.
bc
.
HasBlock
(
block
.
Hash
())
{
fmt
.
Println
(
"already having this block"
)
return
nil
,
nil
,
&
KnownBlockError
{
block
.
Number
,
block
.
Hash
()}
return
nil
,
nil
,
nil
}
}
if
!
sm
.
bc
.
HasBlock
(
block
.
PrevHash
)
{
if
!
sm
.
bc
.
HasBlock
(
block
.
PrevHash
)
{
...
@@ -233,12 +232,10 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me
...
@@ -233,12 +232,10 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me
// Block validation
// Block validation
if
err
=
sm
.
ValidateBlock
(
block
,
parent
);
err
!=
nil
{
if
err
=
sm
.
ValidateBlock
(
block
,
parent
);
err
!=
nil
{
statelogger
.
Errorln
(
"validating block:"
,
err
)
return
return
}
}
if
err
=
sm
.
AccumelateRewards
(
state
,
block
,
parent
);
err
!=
nil
{
if
err
=
sm
.
AccumelateRewards
(
state
,
block
,
parent
);
err
!=
nil
{
statelogger
.
Errorln
(
"accumulating reward"
,
err
)
return
return
}
}
...
@@ -271,7 +268,6 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me
...
@@ -271,7 +268,6 @@ func (sm *BlockManager) ProcessWithParent(block, parent *Block) (td *big.Int, me
sm
.
transState
=
state
.
Copy
()
sm
.
transState
=
state
.
Copy
()
sm
.
eth
.
TxPool
()
.
RemoveSet
(
block
.
Transactions
())
sm
.
eth
.
TxPool
()
.
RemoveSet
(
block
.
Transactions
())
fmt
.
Println
(
"TD"
,
td
)
return
td
,
messages
,
nil
return
td
,
messages
,
nil
}
else
{
}
else
{
...
...
chain/chain_manager.go
View file @
5ebae82e
...
@@ -330,10 +330,10 @@ func (self *ChainManager) InsertChain(chain Blocks) error {
...
@@ -330,10 +330,10 @@ func (self *ChainManager) InsertChain(chain Blocks) error {
continue
continue
}
}
chainlogger
.
Infof
(
"block process failed %v (%x)
\n
"
,
block
.
Number
,
block
.
Hash
()[
:
4
])
return
err
return
err
}
}
fmt
.
Println
(
td
,
messages
,
err
)
self
.
add
(
block
)
self
.
add
(
block
)
self
.
SetTotalDifficulty
(
td
)
self
.
SetTotalDifficulty
(
td
)
self
.
Ethereum
.
EventMux
()
.
Post
(
NewBlockEvent
{
block
})
self
.
Ethereum
.
EventMux
()
.
Post
(
NewBlockEvent
{
block
})
...
...
chain/error.go
View file @
5ebae82e
...
@@ -128,12 +128,12 @@ func IsTDError(e error) bool {
...
@@ -128,12 +128,12 @@ func IsTDError(e error) bool {
}
}
type
KnownBlockError
struct
{
type
KnownBlockError
struct
{
number
uint64
number
*
big
.
Int
hash
[]
byte
hash
[]
byte
}
}
func
(
self
*
KnownBlockError
)
Error
()
string
{
func
(
self
*
KnownBlockError
)
Error
()
string
{
return
fmt
.
Sprintf
(
"block %
d
already known (%x)"
,
self
.
number
,
self
.
hash
[
0
:
4
])
return
fmt
.
Sprintf
(
"block %
v
already known (%x)"
,
self
.
number
,
self
.
hash
[
0
:
4
])
}
}
func
IsKnownBlockErr
(
e
error
)
bool
{
func
IsKnownBlockErr
(
e
error
)
bool
{
_
,
ok
:=
e
.
(
*
KnownBlockError
)
_
,
ok
:=
e
.
(
*
KnownBlockError
)
...
...
cmd/mist/assets/qml/views/miner.qml
View file @
5ebae82e
...
@@ -119,12 +119,14 @@ Rectangle {
...
@@ -119,12 +119,14 @@ Rectangle {
}
}
}
}
Component.onCompleted
:
{
Component.onCompleted
:
{
/*
// XXX Temp. replace with above eventually
// XXX Temp. replace with above eventually
var tmpItems = ["JEVCoin", "Some coin", "Other coin", "Etc coin"];
var tmpItems = ["JEVCoin", "Some coin", "Other coin", "Etc coin"];
var address = "e6716f9544a56c530d868e4bfbacb172315bdead";
var address = "e6716f9544a56c530d868e4bfbacb172315bdead";
for (var i = 0; i < tmpItems.length; i++) {
for (var i = 0; i < tmpItems.length; i++) {
mergedMiningModel.append({checked: false, name: tmpItems[i], address: address, id: 0, itemId: i});
mergedMiningModel.append({checked: false, name: tmpItems[i], address: address, id: 0, itemId: i});
}
}
*/
}
}
}
}
}
}
...
...
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