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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
ca31d711
Commit
ca31d711
authored
9 years ago
by
Felix Lange
Committed by
Jeffrey Wilcke
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
core: remove unused code from TxPool
parent
08befff8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/transaction_pool.go
+13
-41
13 additions, 41 deletions
core/transaction_pool.go
with
13 additions
and
41 deletions
core/transaction_pool.go
+
13
−
41
View file @
ca31d711
...
...
@@ -14,7 +14,6 @@ import (
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"gopkg.in/fatih/set.v0"
)
var
(
...
...
@@ -28,58 +27,31 @@ var (
ErrNegativeValue
=
errors
.
New
(
"Negative value"
)
)
const
txPoolQueueSize
=
50
type
TxPoolHook
chan
*
types
.
Transaction
type
TxMsg
struct
{
Tx
*
types
.
Transaction
}
type
stateFn
func
()
*
state
.
StateDB
const
(
minGasPrice
=
1000000
)
type
TxProcessor
interface
{
ProcessTransaction
(
tx
*
types
.
Transaction
)
}
// The tx pool a thread safe transaction pool handler. In order to
// guarantee a non blocking pool we use a queue channel which can be
// independently read without needing access to the actual pool.
type
TxPool
struct
{
mu
sync
.
RWMutex
// Queueing channel for reading and writing incoming
// transactions to
queueChan
chan
*
types
.
Transaction
// Quiting channel
quit
chan
bool
// The state function which will allow us to do some pre checkes
currentState
stateFn
// The current gas limit function callback
gasLimit
func
()
*
big
.
Int
// The actual pool
txs
map
[
common
.
Hash
]
*
types
.
Transaction
invalidHashes
*
set
.
Set
quit
chan
bool
// Quiting channel
currentState
stateFn
// The state function which will allow us to do some pre checkes
gasLimit
func
()
*
big
.
Int
// The current gas limit function callback
eventMux
*
event
.
TypeMux
mu
sync
.
RWMutex
txs
map
[
common
.
Hash
]
*
types
.
Transaction
// The actual pool
queue
map
[
common
.
Address
]
map
[
common
.
Hash
]
*
types
.
Transaction
subscribers
[]
chan
TxMsg
eventMux
*
event
.
TypeMux
}
func
NewTxPool
(
eventMux
*
event
.
TypeMux
,
currentStateFn
stateFn
,
gasLimitFn
func
()
*
big
.
Int
)
*
TxPool
{
txPool
:=
&
TxPool
{
txs
:
make
(
map
[
common
.
Hash
]
*
types
.
Transaction
),
queue
:
make
(
map
[
common
.
Address
]
map
[
common
.
Hash
]
*
types
.
Transaction
),
queueChan
:
make
(
chan
*
types
.
Transaction
,
txPoolQueueSize
),
quit
:
make
(
chan
bool
),
eventMux
:
eventMux
,
invalidHashes
:
set
.
New
(),
currentState
:
currentStateFn
,
gasLimit
:
gasLimitFn
,
return
&
TxPool
{
txs
:
make
(
map
[
common
.
Hash
]
*
types
.
Transaction
),
queue
:
make
(
map
[
common
.
Address
]
map
[
common
.
Hash
]
*
types
.
Transaction
),
quit
:
make
(
chan
bool
),
eventMux
:
eventMux
,
currentState
:
currentStateFn
,
gasLimit
:
gasLimitFn
,
}
return
txPool
}
func
(
pool
*
TxPool
)
Start
()
{
...
...
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