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
3a2bddc1
Commit
3a2bddc1
authored
May 15, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored to reactor. Fixes #42
parent
9ba3c6d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
gui.go
ethereal/ui/gui.go
+7
-6
No files found.
ethereal/ui/gui.go
View file @
3a2bddc1
...
...
@@ -178,13 +178,14 @@ func (gui *Gui) setWalletValue(amount, unconfirmedFunds *big.Int) {
// Simple go routine function that updates the list of peers in the GUI
func
(
gui
*
Gui
)
update
()
{
blockChan
:=
make
(
chan
ethutil
.
React
,
1
)
reactor
:=
gui
.
eth
.
Reactor
()
reactor
.
Subscribe
(
"newBlock"
,
blockChan
)
blockChan
:=
make
(
chan
ethutil
.
React
,
1
)
txChan
:=
make
(
chan
ethutil
.
React
,
1
)
txChan
:=
make
(
chan
ethchain
.
TxMsg
,
1
)
gui
.
eth
.
TxPool
()
.
Subscribe
(
txChan
)
reactor
.
Subscribe
(
"newBlock"
,
blockChan
)
reactor
.
Subscribe
(
"newTx:pre"
,
txChan
)
reactor
.
Subscribe
(
"newTx:post"
,
txChan
)
state
:=
gui
.
eth
.
StateManager
()
.
TransState
()
...
...
@@ -200,9 +201,9 @@ func (gui *Gui) update() {
}
case
txMsg
:=
<-
txChan
:
tx
:=
txMsg
.
Tx
tx
:=
txMsg
.
Resource
.
(
*
ethchain
.
Transaction
)
if
txMsg
.
Type
==
ethchain
.
TxPre
{
if
txMsg
.
Event
==
"newTx:pre"
{
object
:=
state
.
GetAccount
(
gui
.
addr
)
if
bytes
.
Compare
(
tx
.
Sender
(),
gui
.
addr
)
==
0
&&
object
.
Nonce
<=
tx
.
Nonce
{
...
...
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