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
ca31d711
Commit
ca31d711
authored
Jun 03, 2015
by
Felix Lange
Committed by
obscuren
Jun 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: remove unused code from TxPool
parent
08befff8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
41 deletions
+13
-41
transaction_pool.go
core/transaction_pool.go
+13
-41
No files found.
core/transaction_pool.go
View file @
ca31d711
...
@@ -14,7 +14,6 @@ import (
...
@@ -14,7 +14,6 @@ import (
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/logger/glog"
"gopkg.in/fatih/set.v0"
)
)
var
(
var
(
...
@@ -28,58 +27,31 @@ var (
...
@@ -28,58 +27,31 @@ var (
ErrNegativeValue
=
errors
.
New
(
"Negative value"
)
ErrNegativeValue
=
errors
.
New
(
"Negative value"
)
)
)
const
txPoolQueueSize
=
50
type
TxPoolHook
chan
*
types
.
Transaction
type
TxMsg
struct
{
Tx
*
types
.
Transaction
}
type
stateFn
func
()
*
state
.
StateDB
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
// 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
// guarantee a non blocking pool we use a queue channel which can be
// independently read without needing access to the actual pool.
// independently read without needing access to the actual pool.
type
TxPool
struct
{
type
TxPool
struct
{
mu
sync
.
RWMutex
quit
chan
bool
// Quiting channel
// Queueing channel for reading and writing incoming
currentState
stateFn
// The state function which will allow us to do some pre checkes
// transactions to
gasLimit
func
()
*
big
.
Int
// The current gas limit function callback
queueChan
chan
*
types
.
Transaction
eventMux
*
event
.
TypeMux
// 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
mu
sync
.
RWMutex
txs
map
[
common
.
Hash
]
*
types
.
Transaction
// The actual pool
queue
map
[
common
.
Address
]
map
[
common
.
Hash
]
*
types
.
Transaction
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
{
func
NewTxPool
(
eventMux
*
event
.
TypeMux
,
currentStateFn
stateFn
,
gasLimitFn
func
()
*
big
.
Int
)
*
TxPool
{
txPool
:=
&
TxPool
{
return
&
TxPool
{
txs
:
make
(
map
[
common
.
Hash
]
*
types
.
Transaction
),
txs
:
make
(
map
[
common
.
Hash
]
*
types
.
Transaction
),
queue
:
make
(
map
[
common
.
Address
]
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
),
quit
:
make
(
chan
bool
),
eventMux
:
eventMux
,
eventMux
:
eventMux
,
currentState
:
currentStateFn
,
invalidHashes
:
set
.
New
(),
gasLimit
:
gasLimitFn
,
currentState
:
currentStateFn
,
gasLimit
:
gasLimitFn
,
}
}
return
txPool
}
}
func
(
pool
*
TxPool
)
Start
()
{
func
(
pool
*
TxPool
)
Start
()
{
...
...
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