mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
- bring changes in line with official repository
This commit is contained in:
parent
7681acfc55
commit
816ce69308
2 changed files with 15 additions and 24 deletions
|
|
@ -144,15 +144,15 @@ type TxPoolConfig struct {
|
||||||
// pool.
|
// pool.
|
||||||
var DefaultTxPoolConfig = TxPoolConfig{
|
var DefaultTxPoolConfig = TxPoolConfig{
|
||||||
Journal: "transactions.rlp",
|
Journal: "transactions.rlp",
|
||||||
Rejournal: 24*time.Hour,
|
Rejournal: time.Hour,
|
||||||
|
|
||||||
PriceLimit: 50,
|
PriceLimit: 1,
|
||||||
PriceBump: 10,
|
PriceBump: 10,
|
||||||
|
|
||||||
AccountSlots: 16,
|
AccountSlots: 16,
|
||||||
GlobalSlots: 200,
|
GlobalSlots: 4096,
|
||||||
AccountQueue: 64,
|
AccountQueue: 64,
|
||||||
GlobalQueue: 100,
|
GlobalQueue: 1024,
|
||||||
|
|
||||||
Lifetime: 3 * time.Hour,
|
Lifetime: 3 * time.Hour,
|
||||||
}
|
}
|
||||||
|
|
@ -351,14 +351,6 @@ func (pool *TxPool) lockedReset(oldHead, newHead *types.Header) {
|
||||||
// reset retrieves the current state of the blockchain and ensures the content
|
// reset retrieves the current state of the blockchain and ensures the content
|
||||||
// of the transaction pool is valid with regard to the chain state.
|
// of the transaction pool is valid with regard to the chain state.
|
||||||
func (pool *TxPool) reset(oldHead, newHead *types.Header) {
|
func (pool *TxPool) reset(oldHead, newHead *types.Header) {
|
||||||
log.Info("TxPool reset exec")
|
|
||||||
/*
|
|
||||||
pool.pending = make(map[common.Address]*txList) // All currently processable transactions
|
|
||||||
pool.queue = make(map[common.Address]*txList) // Queued but non-processable transactions
|
|
||||||
pool.beats = make(map[common.Address]time.Time) // Last heartbeat from each known account
|
|
||||||
pool.all = make(map[common.Hash]*types.Transaction) // All transactions to allow lookups
|
|
||||||
pool.priced = nil // All transactions sorted by price*/
|
|
||||||
return
|
|
||||||
// If we're reorging an old state, reinject all dropped transactions
|
// If we're reorging an old state, reinject all dropped transactions
|
||||||
var reinject types.Transactions
|
var reinject types.Transactions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,11 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
//"github.com/ethereum/go-ethereum/metrics"
|
"github.com/ethereum/go-ethereum/metrics"
|
||||||
"github.com/dgraph-io/badger"
|
"github.com/dgraph-io/badger"
|
||||||
"github.com/dgraph-io/badger/options"
|
"github.com/dgraph-io/badger/options"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
||||||
gometrics "github.com/rcrowley/go-metrics"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -37,15 +36,15 @@ type BadgerDatabase struct {
|
||||||
fn string // filename for reporting
|
fn string // filename for reporting
|
||||||
db *badger.DB
|
db *badger.DB
|
||||||
badgerCache *BadgerCache
|
badgerCache *BadgerCache
|
||||||
getTimer gometrics.Timer // Timer for measuring the database get request counts and latencies
|
getTimer metrics.Timer // Timer for measuring the database get request counts and latencies
|
||||||
putTimer gometrics.Timer // Timer for measuring the database put request counts and latencies
|
putTimer metrics.Timer // Timer for measuring the database put request counts and latencies
|
||||||
delTimer gometrics.Timer // Timer for measuring the database delete request counts and latencies
|
delTimer metrics.Timer // Timer for measuring the database delete request counts and latencies
|
||||||
missMeter gometrics.Meter // Meter for measuring the missed database get requests
|
missMeter metrics.Meter // Meter for measuring the missed database get requests
|
||||||
readMeter gometrics.Meter // Meter for measuring the database get request data usage
|
readMeter metrics.Meter // Meter for measuring the database get request data usage
|
||||||
writeMeter gometrics.Meter // Meter for measuring the database put request data usage
|
writeMeter metrics.Meter // Meter for measuring the database put request data usage
|
||||||
compTimeMeter gometrics.Meter // Meter for measuring the total time spent in database compaction
|
compTimeMeter metrics.Meter // Meter for measuring the total time spent in database compaction
|
||||||
compReadMeter gometrics.Meter // Meter for measuring the data read during compaction
|
compReadMeter metrics.Meter // Meter for measuring the data read during compaction
|
||||||
compWriteMeter gometrics.Meter // Meter for measuring the data written during compaction
|
compWriteMeter metrics.Meter // Meter for measuring the data written during compaction
|
||||||
|
|
||||||
quitLock sync.Mutex // Mutex protecting the quit channel access
|
quitLock sync.Mutex // Mutex protecting the quit channel access
|
||||||
quitChan chan chan error // Quit channel to stop the metrics collection before closing the database
|
quitChan chan chan error // Quit channel to stop the metrics collection before closing the database
|
||||||
|
|
@ -75,7 +74,7 @@ func NewBadgerDatabase(file string) (*BadgerDatabase, error) {
|
||||||
log: logger,
|
log: logger,
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.badgerCache = &BadgerCache{db: ret, c: make(map[string][]byte), size: 0, limit: 100000000}
|
ret.badgerCache = &BadgerCache{db: ret, c: make(map[string][]byte), size: 0, limit: 500000000}
|
||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue