aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-06 07:19:07 +0800
committerobscuren <geffobscura@gmail.com>2015-01-06 07:19:07 +0800
commit47e6b2cef8ee0164e82d119c6a9359b55259d645 (patch)
tree346912a0c62553b9421acf12dcce14cef4fb498f
parentcc7f8f58e81b3607d5a003fe7789dadb7a99fe54 (diff)
downloaddexon-47e6b2cef8ee0164e82d119c6a9359b55259d645.tar.gz
dexon-47e6b2cef8ee0164e82d119c6a9359b55259d645.tar.zst
dexon-47e6b2cef8ee0164e82d119c6a9359b55259d645.zip
Allow extra to be set for mined blocks
-rw-r--r--cmd/mist/assets/qml/views/miner.qml19
-rw-r--r--cmd/mist/ui_lib.go4
-rw-r--r--miner/miner.go2
3 files changed, 25 insertions, 0 deletions
diff --git a/cmd/mist/assets/qml/views/miner.qml b/cmd/mist/assets/qml/views/miner.qml
index e0182649f..193ce37be 100644
--- a/cmd/mist/assets/qml/views/miner.qml
+++ b/cmd/mist/assets/qml/views/miner.qml
@@ -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
+ }
+ }
}
}
diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go
index 0aabb87d0..933c323de 100644
--- a/cmd/mist/ui_lib.go
+++ b/cmd/mist/ui_lib.go
@@ -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()
diff --git a/miner/miner.go b/miner/miner.go
index 949227d98..f80ae51c6 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -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 {