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
47e6b2ce
Commit
47e6b2ce
authored
Jan 05, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow extra to be set for mined blocks
parent
cc7f8f58
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
miner.qml
cmd/mist/assets/qml/views/miner.qml
+19
-0
ui_lib.go
cmd/mist/ui_lib.go
+4
-0
miner.go
miner/miner.go
+2
-0
No files found.
cmd/mist/assets/qml/views/miner.qml
View file @
47e6b2ce
...
...
@@ -46,6 +46,7 @@ Rectangle {
text
:
"Start"
onClicked
:
{
eth
.
setGasPrice
(
minGasPrice
.
text
||
"10000000000000"
);
eth
.
setExtra
(
blockExtra
.
text
)
if
(
eth
.
toggleMining
())
{
this
.
text
=
"Stop"
;
}
else
{
...
...
@@ -55,6 +56,7 @@ Rectangle {
}
Rectangle
{
id
:
minGasPriceRect
anchors.top
:
parent
.
top
anchors.topMargin
:
2
width
:
200
...
...
@@ -65,6 +67,23 @@ Rectangle {
validator
:
RegExpValidator
{
regExp
:
/
\d
*/
}
}
}
Rectangle
{
width
:
300
anchors
{
left
:
minGasPriceRect
.
right
leftMargin
:
5
top
:
parent
.
top
topMargin
:
2
}
TextField
{
id
:
blockExtra
placeholderText
:
"Extra"
width
:
parent
.
width
maximumLength
:
1024
}
}
}
}
...
...
cmd/mist/ui_lib.go
View file @
47e6b2ce
...
...
@@ -279,6 +279,10 @@ func (self *UiLib) SetGasPrice(price string) {
self
.
miner
.
MinAcceptedGasPrice
=
ethutil
.
Big
(
price
)
}
func
(
self
*
UiLib
)
SetExtra
(
extra
string
)
{
self
.
miner
.
Extra
=
extra
}
func
(
self
*
UiLib
)
ToggleMining
()
bool
{
if
!
self
.
miner
.
Mining
()
{
self
.
miner
.
Start
()
...
...
miner/miner.go
View file @
47e6b2ce
...
...
@@ -69,6 +69,7 @@ type Miner struct {
mining
bool
MinAcceptedGasPrice
*
big
.
Int
Extra
string
}
func
New
(
coinbase
[]
byte
,
eth
*
eth
.
Ethereum
)
*
Miner
{
...
...
@@ -178,6 +179,7 @@ func (self *Miner) mine() {
chainMan
=
self
.
eth
.
ChainManager
()
block
=
chainMan
.
NewBlock
(
self
.
Coinbase
)
)
block
.
Header
()
.
Extra
=
self
.
Extra
// Apply uncles
if
len
(
self
.
uncles
)
>
0
{
...
...
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