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
0dc56612
Commit
0dc56612
authored
Dec 18, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
Merge fixes
parent
721e8ae9
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
core/chain_manager.go
+4
-1
4 additions, 1 deletion
core/chain_manager.go
core/transaction_pool.go
+2
-4
2 additions, 4 deletions
core/transaction_pool.go
core/types/common.go
+0
-5
0 additions, 5 deletions
core/types/common.go
eth/backend.go
+2
-2
2 additions, 2 deletions
eth/backend.go
with
8 additions
and
12 deletions
core/chain_manager.go
+
4
−
1
View file @
0dc56612
...
@@ -101,7 +101,10 @@ func NewChainManager(mux *event.TypeMux) *ChainManager {
...
@@ -101,7 +101,10 @@ func NewChainManager(mux *event.TypeMux) *ChainManager {
}
}
func
(
self
*
ChainManager
)
Status
()
(
td
*
big
.
Int
,
currentBlock
[]
byte
,
genesisBlock
[]
byte
)
{
func
(
self
*
ChainManager
)
Status
()
(
td
*
big
.
Int
,
currentBlock
[]
byte
,
genesisBlock
[]
byte
)
{
return
self
.
TD
,
self
.
CurrentBlock
.
Hash
(),
self
.
Genesis
()
.
Hash
()
self
.
mu
.
RLock
()
defer
self
.
mu
.
RUnlock
()
return
self
.
td
,
self
.
currentBlock
.
Hash
(),
self
.
Genesis
()
.
Hash
()
}
}
func
(
self
*
ChainManager
)
SetProcessor
(
proc
types
.
BlockProcessor
)
{
func
(
self
*
ChainManager
)
SetProcessor
(
proc
types
.
BlockProcessor
)
{
...
...
This diff is collapsed.
Click to expand it.
core/transaction_pool.go
+
2
−
4
View file @
0dc56612
...
@@ -72,19 +72,17 @@ type TxPool struct {
...
@@ -72,19 +72,17 @@ type TxPool struct {
subscribers
[]
chan
TxMsg
subscribers
[]
chan
TxMsg
broadcaster
types
.
Broadcaster
chainManager
*
ChainManager
chainManager
*
ChainManager
eventMux
*
event
.
TypeMux
eventMux
*
event
.
TypeMux
}
}
func
NewTxPool
(
chainManager
*
ChainManager
,
broadcaster
types
.
Broadcaster
,
eventMux
*
event
.
TypeMux
)
*
TxPool
{
func
NewTxPool
(
chainManager
*
ChainManager
,
eventMux
*
event
.
TypeMux
)
*
TxPool
{
return
&
TxPool
{
return
&
TxPool
{
pool
:
list
.
New
(),
pool
:
list
.
New
(),
queueChan
:
make
(
chan
*
types
.
Transaction
,
txPoolQueueSize
),
queueChan
:
make
(
chan
*
types
.
Transaction
,
txPoolQueueSize
),
quit
:
make
(
chan
bool
),
quit
:
make
(
chan
bool
),
chainManager
:
chainManager
,
chainManager
:
chainManager
,
eventMux
:
eventMux
,
eventMux
:
eventMux
,
broadcaster
:
broadcaster
,
}
}
}
}
...
@@ -96,7 +94,7 @@ func (pool *TxPool) addTransaction(tx *types.Transaction) {
...
@@ -96,7 +94,7 @@ func (pool *TxPool) addTransaction(tx *types.Transaction) {
pool
.
pool
.
PushBack
(
tx
)
pool
.
pool
.
PushBack
(
tx
)
// Broadcast the transaction to the rest of the peers
// Broadcast the transaction to the rest of the peers
pool
.
Ethereum
.
E
ventMux
()
.
Post
(
TxPreEvent
{
tx
})
pool
.
e
ventMux
.
Post
(
TxPreEvent
{
tx
})
}
}
func
(
pool
*
TxPool
)
ValidateTransaction
(
tx
*
types
.
Transaction
)
error
{
func
(
pool
*
TxPool
)
ValidateTransaction
(
tx
*
types
.
Transaction
)
error
{
...
...
This diff is collapsed.
Click to expand it.
core/types/common.go
+
0
−
5
View file @
0dc56612
...
@@ -4,13 +4,8 @@ import (
...
@@ -4,13 +4,8 @@ import (
"math/big"
"math/big"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/wire"
)
)
type
BlockProcessor
interface
{
type
BlockProcessor
interface
{
Process
(
*
Block
)
(
*
big
.
Int
,
state
.
Messages
,
error
)
Process
(
*
Block
)
(
*
big
.
Int
,
state
.
Messages
,
error
)
}
}
type
Broadcaster
interface
{
Broadcast
(
wire
.
MsgType
,
[]
interface
{})
}
This diff is collapsed.
Click to expand it.
eth/backend.go
+
2
−
2
View file @
0dc56612
...
@@ -69,9 +69,9 @@ func New(db ethutil.Database, identity p2p.ClientIdentity, keyManager *crypto.Ke
...
@@ -69,9 +69,9 @@ func New(db ethutil.Database, identity p2p.ClientIdentity, keyManager *crypto.Ke
eventMux
:
&
event
.
TypeMux
{},
eventMux
:
&
event
.
TypeMux
{},
}
}
eth
.
txPool
=
core
.
NewTxPool
(
eth
)
eth
.
chainManager
=
core
.
NewChainManager
(
eth
.
EventMux
())
eth
.
chainManager
=
core
.
NewChainManager
(
eth
.
EventMux
())
eth
.
blockManager
=
core
.
NewBlockManager
(
eth
)
eth
.
txPool
=
core
.
NewTxPool
(
eth
.
chainManager
,
eth
.
EventMux
())
eth
.
blockManager
=
core
.
NewBlockManager
(
eth
.
txPool
,
eth
.
chainManager
,
eth
.
EventMux
())
eth
.
chainManager
.
SetProcessor
(
eth
.
blockManager
)
eth
.
chainManager
.
SetProcessor
(
eth
.
blockManager
)
eth
.
whisper
=
whisper
.
New
()
eth
.
whisper
=
whisper
.
New
()
...
...
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