aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-06-03 20:20:44 +0800
committerobscuren <geffobscura@gmail.com>2015-06-04 04:43:23 +0800
commitca31d71107127a1b4f950e334ee5a99955d97e3c (patch)
tree3ea51aa521c8a0259d97a31b3d64ca2f4a99ad62
parent08befff8f168f0fd59a3ff36a7205ba44fb82540 (diff)
downloadgo-tangerine-ca31d71107127a1b4f950e334ee5a99955d97e3c.tar
go-tangerine-ca31d71107127a1b4f950e334ee5a99955d97e3c.tar.gz
go-tangerine-ca31d71107127a1b4f950e334ee5a99955d97e3c.tar.bz2
go-tangerine-ca31d71107127a1b4f950e334ee5a99955d97e3c.tar.lz
go-tangerine-ca31d71107127a1b4f950e334ee5a99955d97e3c.tar.xz
go-tangerine-ca31d71107127a1b4f950e334ee5a99955d97e3c.tar.zst
go-tangerine-ca31d71107127a1b4f950e334ee5a99955d97e3c.zip
core: remove unused code from TxPool
-rw-r--r--core/transaction_pool.go54
1 files changed, 13 insertions, 41 deletions
diff --git a/core/transaction_pool.go b/core/transaction_pool.go
index d8debe1c0..fa2c4fed6 100644
--- a/core/transaction_pool.go
+++ b/core/transaction_pool.go
@@ -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() {