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
0db86e44
Commit
0db86e44
authored
Mar 21, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to work with the new chain
parent
85e04476
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
Makefile
Makefile
+3
-2
ethereum.go
ethereum.go
+5
-2
gui.go
ui/gui.go
+1
-0
library.go
ui/library.go
+3
-3
No files found.
Makefile
View file @
0db86e44
...
...
@@ -7,11 +7,12 @@ all:
install
:
# Linux build
ifeq
($(UNAME),Linux)
mkdir
/usr/local/ethereal
files
=(
wallet.qml
net.png network.png new.png tx.png
)
mkdir
-p
/usr/local/ethereal
files
=(
net.png network.png new.png tx.png
)
for
file
in
"${files[@]}"
;
do
cp
$file
/usr/share/ethereal
done
cp
-r
qml
/usr/share/ethereal/qml
cp
$GOPATH/bin/go-ethereum
/usr/local/bin/ethereal
endif
# OS X build
...
...
ethereum.go
View file @
0db86e44
...
...
@@ -190,16 +190,19 @@ func main() {
// Apply all transactions to the block
ethereum
.
StateManager
()
.
ApplyTransactions
(
block
,
block
.
Transactions
())
ethereum
.
StateManager
()
.
AccumelateRewards
(
block
,
block
)
ethereum
.
StateManager
()
.
Prepare
(
block
.
State
(),
block
.
State
())
ethereum
.
StateManager
()
.
AccumelateRewards
(
block
)
// Search the nonce
block
.
Nonce
=
pow
.
Search
(
block
)
ethereum
.
Broadcast
(
ethwire
.
MsgBlockTy
,
[]
interface
{}{
block
.
Value
()
.
Val
})
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
.
Println
(
"
\n
+++++++ MINED BLK +++++++
\n
"
,
ethereum
.
BlockChain
()
.
CurrentBlock
)
log
.
Printf
(
"🔨 Mined block %x
\n
"
,
block
.
Hash
())
}
}
...
...
ui/gui.go
View file @
0db86e44
...
...
@@ -81,6 +81,7 @@ func (ui *Gui) Start() {
Init
:
func
(
p
*
Tx
,
obj
qml
.
Object
)
{
p
.
Value
=
""
;
p
.
Hash
=
""
;
p
.
Address
=
""
},
}})
ethutil
.
Config
.
SetClientString
(
fmt
.
Sprintf
(
"/Ethereal v%s"
,
"0.1"
))
ethutil
.
Config
.
Log
.
Infoln
(
"[GUI] Starting GUI"
)
// Create a new QML engine
ui
.
engine
=
qml
.
NewEngine
()
...
...
ui/library.go
View file @
0db86e44
...
...
@@ -27,14 +27,14 @@ func (lib *EthLib) CreateTx(receiver, a, data string) string {
}
k
,
_
:=
ethutil
.
Config
.
Db
.
Get
([]
byte
(
"KeyRing"
))
key
Ring
:=
ethutil
.
NewValue
FromBytes
(
k
)
key
Pair
:=
ethutil
.
NewKey
FromBytes
(
k
)
amount
:=
ethutil
.
Big
(
a
)
code
:=
ethchain
.
Compile
(
strings
.
Split
(
data
,
"
\n
"
))
tx
:=
ethchain
.
NewTransaction
(
hash
,
amount
,
code
)
tx
.
Nonce
=
lib
.
stateManager
.
GetAddrState
(
key
Ring
.
Get
(
1
)
.
Byte
s
())
.
Nonce
tx
.
Nonce
=
lib
.
stateManager
.
GetAddrState
(
key
Pair
.
Addres
s
())
.
Nonce
tx
.
Sign
(
key
Ring
.
Get
(
0
)
.
Bytes
()
)
tx
.
Sign
(
key
Pair
.
PrivateKey
)
lib
.
txPool
.
QueueTransaction
(
tx
)
...
...
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