2018-06-04 21:10:59 +00:00
|
|
|
// Package txpool handles incoming transactions for a sharded Ethereum blockchain.
|
|
|
|
package txpool
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/log"
|
2018-06-13 12:44:33 +00:00
|
|
|
"github.com/ethereum/go-ethereum/sharding/p2p"
|
2018-06-04 21:10:59 +00:00
|
|
|
)
|
|
|
|
|
2018-06-13 12:44:33 +00:00
|
|
|
// TXPool handles a transaction pool for a sharded system.
|
|
|
|
type TXPool struct {
|
|
|
|
p2p *p2p.Server
|
2018-06-05 21:28:57 +00:00
|
|
|
}
|
2018-06-04 21:10:59 +00:00
|
|
|
|
2018-06-13 12:44:33 +00:00
|
|
|
// NewTXPool creates a new observer instance.
|
|
|
|
func NewTXPool(p2p *p2p.Server) (*TXPool, error) {
|
|
|
|
return &TXPool{p2p}, nil
|
2018-06-04 21:10:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Start the main routine for a shard transaction pool.
|
2018-06-13 12:44:33 +00:00
|
|
|
func (p *TXPool) Start() {
|
2018-06-04 21:10:59 +00:00
|
|
|
log.Info("Starting shard txpool service")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Stop the main loop for a transaction pool in the shard network.
|
2018-06-13 12:44:33 +00:00
|
|
|
func (p *TXPool) Stop() error {
|
2018-06-04 21:10:59 +00:00
|
|
|
log.Info("Stopping shard txpool service")
|
|
|
|
return nil
|
|
|
|
}
|