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
52b63459
Commit
52b63459
authored
Apr 09, 2014
by
Maran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/mnemonic
parents
2edf133b
1e94cb52
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
37 deletions
+37
-37
wallet.qml
ethereal/assets/qml/wallet.qml
+15
-2
library.go
ethereal/ui/library.go
+7
-5
ui_lib.go
ethereal/ui/ui_lib.go
+0
-1
ethereum.go
ethereum/ethereum.go
+15
-29
No files found.
ethereal/assets/qml/wallet.qml
View file @
52b63459
...
...
@@ -199,9 +199,22 @@ ApplicationWindow {
text
:
"Send"
onClicked
:
{
//this.enabled = false
console
.
log
(
eth
.
createTx
(
txRecipient
.
text
,
txValue
.
text
,
txGas
.
text
,
txGasPrice
.
text
,
codeView
.
text
))
var
res
=
eth
.
createTx
(
txRecipient
.
text
,
txValue
.
text
,
txGas
.
text
,
txGasPrice
.
text
,
codeView
.
text
)
if
(
res
[
1
])
{
txOutput
.
text
=
"Output:
\n
"
+
res
[
1
].
error
()
}
else
{
txOutput
.
text
=
"Output:
\n
"
+
res
[
0
]
}
txOutput
.
visible
=
true
}
}
TextArea
{
id
:
txOutput
visible
:
false
Layout.fillWidth
:
true
height
:
40
anchors.bottom
:
parent
.
bottom
}
}
}
...
...
@@ -391,7 +404,7 @@ ApplicationWindow {
anchors.left
:
aboutIcon
.
right
anchors.leftMargin
:
10
font.pointSize
:
12
text
:
"<h2>Ethere
um(Go)</h2><br><h3>Development</h3>Jeffrey Wilcke
<br><h3>Binary Distribution</h3>Jarrad Hope<br>"
text
:
"<h2>Ethere
al</h2><br><h3>Development</h3>Jeffrey Wilcke<br>Maran Hidskes
<br><h3>Binary Distribution</h3>Jarrad Hope<br>"
}
}
...
...
ethereal/ui/library.go
View file @
52b63459
...
...
@@ -15,7 +15,7 @@ type EthLib struct {
txPool
*
ethchain
.
TxPool
}
func
(
lib
*
EthLib
)
CreateTx
(
recipient
,
valueStr
,
gasStr
,
gasPriceStr
,
data
string
)
string
{
func
(
lib
*
EthLib
)
CreateTx
(
recipient
,
valueStr
,
gasStr
,
gasPriceStr
,
data
string
)
(
string
,
error
)
{
var
hash
[]
byte
var
contractCreation
bool
if
len
(
recipient
)
==
0
{
...
...
@@ -24,7 +24,7 @@ func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data strin
var
err
error
hash
,
err
=
hex
.
DecodeString
(
recipient
)
if
err
!=
nil
{
return
err
.
Error
()
return
""
,
err
}
}
...
...
@@ -37,7 +37,7 @@ func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data strin
if
contractCreation
{
asm
,
err
:=
mutan
.
Compile
(
strings
.
NewReader
(
data
),
false
)
if
err
!=
nil
{
return
err
.
Error
()
return
""
,
err
}
code
:=
ethutil
.
Assemble
(
asm
...
)
...
...
@@ -45,7 +45,9 @@ func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data strin
}
else
{
tx
=
ethchain
.
NewTransactionMessage
(
hash
,
value
,
gasPrice
,
gas
,
[]
string
{})
}
tx
.
Nonce
=
lib
.
stateManager
.
GetAddrState
(
keyPair
.
Address
())
.
Nonce
acc
:=
lib
.
stateManager
.
GetAddrState
(
keyPair
.
Address
())
tx
.
Nonce
=
acc
.
Nonce
//acc.Nonce++
tx
.
Sign
(
keyPair
.
PrivateKey
)
lib
.
txPool
.
QueueTransaction
(
tx
)
...
...
@@ -55,7 +57,7 @@ func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data strin
ethutil
.
Config
.
Log
.
Infof
(
"Tx hash %x"
,
tx
.
Hash
())
}
return
ethutil
.
Hex
(
tx
.
Hash
())
return
ethutil
.
Hex
(
tx
.
Hash
())
,
nil
}
/*
...
...
ethereal/ui/ui_lib.go
View file @
52b63459
...
...
@@ -58,7 +58,6 @@ func (ui *UiLib) AssetPath(p string) string {
func
DefaultAssetPath
()
string
{
var
base
string
// If the current working directory is the go-ethereum dir
// assume a debug build and use the source directory as
// asset directory.
...
...
ethereum/ethereum.go
View file @
52b63459
...
...
@@ -4,8 +4,8 @@ import (
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethminer"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/go-ethereum/utils"
"log"
"os"
...
...
@@ -121,36 +121,22 @@ func main() {
// Fake block mining. It broadcasts a new block every 5 seconds
go
func
()
{
pow
:=
&
ethchain
.
EasyPow
{}
data
,
_
:=
ethutil
.
Config
.
Db
.
Get
([]
byte
(
"KeyRing"
))
keyRing
:=
ethutil
.
NewValueFromBytes
(
data
)
addr
:=
keyRing
.
Get
(
1
)
.
Bytes
()
for
{
txs
:=
ethereum
.
TxPool
()
.
Flush
()
// Create a new block which we're going to mine
block
:=
ethereum
.
BlockChain
()
.
NewBlock
(
addr
,
txs
)
log
.
Println
(
"Mining on new block. Includes"
,
len
(
block
.
Transactions
()),
"transactions"
)
ethereum
.
StateManager
()
.
Prepare
(
block
.
State
(),
block
.
State
())
// Apply all transactions to the block
ethereum
.
StateManager
()
.
ApplyTransactions
(
block
,
block
.
Transactions
())
ethereum
.
StateManager
()
.
AccumelateRewards
(
block
)
// Search the nonce
block
.
Nonce
=
pow
.
Search
(
block
)
ethereum
.
StateManager
()
.
PrepareDefault
(
block
)
err
:=
ethereum
.
StateManager
()
.
ProcessBlock
(
block
)
if
err
!=
nil
{
log
.
Println
(
err
)
}
else
{
log
.
Println
(
"
\n
+++++++ MINED BLK +++++++
\n
"
,
ethereum
.
BlockChain
()
.
CurrentBlock
)
log
.
Printf
(
"🔨 Mined block %x
\n
"
,
block
.
Hash
())
ethereum
.
Broadcast
(
ethwire
.
MsgBlockTy
,
[]
interface
{}{
block
.
Value
()
.
Val
})
}
if
StartMining
{
log
.
Printf
(
"Miner started
\n
"
)
go
func
()
{
data
,
_
:=
ethutil
.
Config
.
Db
.
Get
([]
byte
(
"KeyRing"
))
keyRing
:=
ethutil
.
NewValueFromBytes
(
data
)
addr
:=
keyRing
.
Get
(
1
)
.
Bytes
()
miner
:=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
miner
.
Start
()
}()
}
}()
}
// Wait for shutdown
...
...
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