|
|
@ -18,6 +18,7 @@ type AppContainer interface { |
|
|
|
NewBlock(*ethchain.Block) |
|
|
|
NewBlock(*ethchain.Block) |
|
|
|
ObjectChanged(*ethchain.StateObject) |
|
|
|
ObjectChanged(*ethchain.StateObject) |
|
|
|
StorageChanged(*ethchain.StorageState) |
|
|
|
StorageChanged(*ethchain.StorageState) |
|
|
|
|
|
|
|
NewWatcher(chan bool) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type ExtApplication struct { |
|
|
|
type ExtApplication struct { |
|
|
@ -26,6 +27,7 @@ type ExtApplication struct { |
|
|
|
blockChan chan ethutil.React |
|
|
|
blockChan chan ethutil.React |
|
|
|
changeChan chan ethutil.React |
|
|
|
changeChan chan ethutil.React |
|
|
|
quitChan chan bool |
|
|
|
quitChan chan bool |
|
|
|
|
|
|
|
watcherQuitChan chan bool |
|
|
|
|
|
|
|
|
|
|
|
container AppContainer |
|
|
|
container AppContainer |
|
|
|
lib *UiLib |
|
|
|
lib *UiLib |
|
|
@ -38,6 +40,7 @@ func NewExtApplication(container AppContainer, lib *UiLib) *ExtApplication { |
|
|
|
make(chan ethutil.React, 1), |
|
|
|
make(chan ethutil.React, 1), |
|
|
|
make(chan ethutil.React, 1), |
|
|
|
make(chan ethutil.React, 1), |
|
|
|
make(chan bool), |
|
|
|
make(chan bool), |
|
|
|
|
|
|
|
make(chan bool), |
|
|
|
container, |
|
|
|
container, |
|
|
|
lib, |
|
|
|
lib, |
|
|
|
nil, |
|
|
|
nil, |
|
|
@ -66,6 +69,8 @@ func (app *ExtApplication) run() { |
|
|
|
reactor := app.lib.eth.Reactor() |
|
|
|
reactor := app.lib.eth.Reactor() |
|
|
|
reactor.Subscribe("newBlock", app.blockChan) |
|
|
|
reactor.Subscribe("newBlock", app.blockChan) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.container.NewWatcher(app.watcherQuitChan) |
|
|
|
|
|
|
|
|
|
|
|
win := app.container.Window() |
|
|
|
win := app.container.Window() |
|
|
|
win.Show() |
|
|
|
win.Show() |
|
|
|
win.Wait() |
|
|
|
win.Wait() |
|
|
@ -83,6 +88,7 @@ func (app *ExtApplication) stop() { |
|
|
|
|
|
|
|
|
|
|
|
// Kill the main loop
|
|
|
|
// Kill the main loop
|
|
|
|
app.quitChan <- true |
|
|
|
app.quitChan <- true |
|
|
|
|
|
|
|
app.watcherQuitChan <- true |
|
|
|
|
|
|
|
|
|
|
|
close(app.blockChan) |
|
|
|
close(app.blockChan) |
|
|
|
close(app.quitChan) |
|
|
|
close(app.quitChan) |
|
|
|