good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
96272e19
Commit
96272e19
authored
Dec 15, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
removed filter manager from base
parent
bd908879
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmd/mist/ui_lib.go
+10
-1
10 additions, 1 deletion
cmd/mist/ui_lib.go
eth/backend.go
+0
-15
0 additions, 15 deletions
eth/backend.go
eth/protocol.go
+22
-21
22 additions, 21 deletions
eth/protocol.go
with
32 additions
and
37 deletions
cmd/mist/ui_lib.go
+
10
−
1
View file @
96272e19
...
@@ -24,7 +24,6 @@ import (
...
@@ -24,7 +24,6 @@ import (
"strconv"
"strconv"
"strings"
"strings"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
...
@@ -64,6 +63,7 @@ type UiLib struct {
...
@@ -64,6 +63,7 @@ type UiLib struct {
func
NewUiLib
(
engine
*
qml
.
Engine
,
eth
*
eth
.
Ethereum
,
assetPath
string
)
*
UiLib
{
func
NewUiLib
(
engine
*
qml
.
Engine
,
eth
*
eth
.
Ethereum
,
assetPath
string
)
*
UiLib
{
lib
:=
&
UiLib
{
JSXEth
:
xeth
.
NewJSXEth
(
eth
),
engine
:
engine
,
eth
:
eth
,
assetPath
:
assetPath
,
jsEngine
:
javascript
.
NewJSRE
(
eth
),
filterCallbacks
:
make
(
map
[
int
][]
int
)}
//, filters: make(map[int]*xeth.JSFilter)}
lib
:=
&
UiLib
{
JSXEth
:
xeth
.
NewJSXEth
(
eth
),
engine
:
engine
,
eth
:
eth
,
assetPath
:
assetPath
,
jsEngine
:
javascript
.
NewJSRE
(
eth
),
filterCallbacks
:
make
(
map
[
int
][]
int
)}
//, filters: make(map[int]*xeth.JSFilter)}
lib
.
miner
=
miner
.
New
(
eth
.
KeyManager
()
.
Address
(),
eth
)
lib
.
miner
=
miner
.
New
(
eth
.
KeyManager
()
.
Address
(),
eth
)
//eth.filterManager = filter.NewFilterManager(eth.EventMux())
return
lib
return
lib
}
}
...
@@ -372,3 +372,12 @@ func (self *UiLib) ToggleMining() bool {
...
@@ -372,3 +372,12 @@ func (self *UiLib) ToggleMining() bool {
return
false
return
false
}
}
}
}
/*
// XXX Refactor me & MOVE
func (self *Ethereum) InstallFilter(filter *core.Filter) (id int) {
return self.filterManager.InstallFilter(filter)
}
func (self *Ethereum) UninstallFilter(id int) { self.filterManager.UninstallFilter(id) }
func (self *Ethereum) GetFilter(id int) *core.Filter { return self.filterManager.GetFilter(id) }
*/
This diff is collapsed.
Click to expand it.
eth/backend.go
+
0
−
15
View file @
96272e19
...
@@ -9,7 +9,6 @@ import (
...
@@ -9,7 +9,6 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/event/filter"
ethlogger
"github.com/ethereum/go-ethereum/logger"
ethlogger
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/pow/ezp"
"github.com/ethereum/go-ethereum/pow/ezp"
...
@@ -53,11 +52,6 @@ type Ethereum struct {
...
@@ -53,11 +52,6 @@ type Ethereum struct {
synclock
sync
.
Mutex
synclock
sync
.
Mutex
syncGroup
sync
.
WaitGroup
syncGroup
sync
.
WaitGroup
filterManager
*
filter
.
FilterManager
//filterMu sync.RWMutex
//filterId int
//filters map[int]*core.Filter
Mining
bool
Mining
bool
}
}
...
@@ -81,7 +75,6 @@ func New(db ethutil.Database, identity p2p.ClientIdentity, keyManager *crypto.Ke
...
@@ -81,7 +75,6 @@ func New(db ethutil.Database, identity p2p.ClientIdentity, keyManager *crypto.Ke
eth
.
blockManager
=
core
.
NewBlockManager
(
eth
)
eth
.
blockManager
=
core
.
NewBlockManager
(
eth
)
eth
.
chainManager
.
SetProcessor
(
eth
.
blockManager
)
eth
.
chainManager
.
SetProcessor
(
eth
.
blockManager
)
eth
.
whisper
=
whisper
.
New
()
eth
.
whisper
=
whisper
.
New
()
eth
.
filterManager
=
filter
.
NewFilterManager
(
eth
.
EventMux
())
hasBlock
:=
eth
.
chainManager
.
HasBlock
hasBlock
:=
eth
.
chainManager
.
HasBlock
insertChain
:=
eth
.
chainManager
.
InsertChain
insertChain
:=
eth
.
chainManager
.
InsertChain
...
@@ -163,7 +156,6 @@ func (s *Ethereum) Start(seed bool) error {
...
@@ -163,7 +156,6 @@ func (s *Ethereum) Start(seed bool) error {
}
}
s
.
blockPool
.
Start
()
s
.
blockPool
.
Start
()
s
.
whisper
.
Start
()
s
.
whisper
.
Start
()
s
.
filterManager
.
Start
()
// broadcast transactions
// broadcast transactions
s
.
txSub
=
s
.
eventMux
.
Subscribe
(
core
.
TxPreEvent
{})
s
.
txSub
=
s
.
eventMux
.
Subscribe
(
core
.
TxPreEvent
{})
...
@@ -264,10 +256,3 @@ func saveProtocolVersion(db ethutil.Database) {
...
@@ -264,10 +256,3 @@ func saveProtocolVersion(db ethutil.Database) {
db
.
Put
([]
byte
(
"ProtocolVersion"
),
ethutil
.
NewValue
(
ProtocolVersion
)
.
Bytes
())
db
.
Put
([]
byte
(
"ProtocolVersion"
),
ethutil
.
NewValue
(
ProtocolVersion
)
.
Bytes
())
}
}
}
}
// XXX Refactor me & MOVE
func
(
self
*
Ethereum
)
InstallFilter
(
filter
*
core
.
Filter
)
(
id
int
)
{
return
self
.
filterManager
.
InstallFilter
(
filter
)
}
func
(
self
*
Ethereum
)
UninstallFilter
(
id
int
)
{
self
.
filterManager
.
UninstallFilter
(
id
)
}
func
(
self
*
Ethereum
)
GetFilter
(
id
int
)
*
core
.
Filter
{
return
self
.
filterManager
.
GetFilter
(
id
)
}
This diff is collapsed.
Click to expand it.
eth/protocol.go
+
22
−
21
View file @
96272e19
...
@@ -11,6 +11,25 @@ import (
...
@@ -11,6 +11,25 @@ import (
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rlp"
)
)
const
(
ProtocolVersion
=
49
NetworkId
=
0
ProtocolLength
=
uint64
(
8
)
ProtocolMaxMsgSize
=
10
*
1024
*
1024
)
// eth protocol message codes
const
(
StatusMsg
=
iota
GetTxMsg
// unused
TxMsg
GetBlockHashesMsg
BlockHashesMsg
GetBlocksMsg
BlocksMsg
NewBlockMsg
)
// ethProtocol represents the ethereum wire protocol
// ethProtocol represents the ethereum wire protocol
// instance is running on each peer
// instance is running on each peer
type
ethProtocol
struct
{
type
ethProtocol
struct
{
...
@@ -41,25 +60,6 @@ type blockPool interface {
...
@@ -41,25 +60,6 @@ type blockPool interface {
RemovePeer
(
peerId
string
)
RemovePeer
(
peerId
string
)
}
}
const
(
ProtocolVersion
=
43
NetworkId
=
0
ProtocolLength
=
uint64
(
8
)
ProtocolMaxMsgSize
=
10
*
1024
*
1024
)
// eth protocol message codes
const
(
StatusMsg
=
iota
GetTxMsg
// unused
TxMsg
GetBlockHashesMsg
BlockHashesMsg
GetBlocksMsg
BlocksMsg
NewBlockMsg
)
// message structs used for rlp decoding
// message structs used for rlp decoding
type
newBlockMsgData
struct
{
type
newBlockMsgData
struct
{
Block
*
types
.
Block
Block
*
types
.
Block
...
@@ -279,9 +279,10 @@ func (self *ethProtocol) handleStatus() error {
...
@@ -279,9 +279,10 @@ func (self *ethProtocol) handleStatus() error {
return
ProtocolError
(
ErrProtocolVersionMismatch
,
"%d (!= %d)"
,
status
.
ProtocolVersion
,
ProtocolVersion
)
return
ProtocolError
(
ErrProtocolVersionMismatch
,
"%d (!= %d)"
,
status
.
ProtocolVersion
,
ProtocolVersion
)
}
}
self
.
peer
.
Infof
(
"Peer is [eth] capable (%d/%d). TD
= %v ~ %x
"
,
status
.
ProtocolVersion
,
status
.
NetworkId
,
status
.
CurrentBlock
)
self
.
peer
.
Infof
(
"Peer is [eth] capable (%d/%d). TD
=%v H=%x
\n
"
,
status
.
ProtocolVersion
,
status
.
NetworkId
,
status
.
TD
,
status
.
CurrentBlock
[
:
4
]
)
self
.
blockPool
.
AddPeer
(
status
.
TD
,
status
.
CurrentBlock
,
self
.
id
,
self
.
requestBlockHashes
,
self
.
requestBlocks
,
self
.
protoErrorDisconnect
)
//self.blockPool.AddPeer(status.TD, status.CurrentBlock, self.id, self.requestBlockHashes, self.requestBlocks, self.protoErrorDisconnect)
self
.
peer
.
Infoln
(
"AddPeer(IGNORED)"
)
return
nil
return
nil
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment