everything but binary, common, and blocks are explicitly imported.

This commit is contained in:
Jae Kwon
2014-10-16 16:00:48 -07:00
parent 300f12dd63
commit ac147e2353
13 changed files with 84 additions and 75 deletions

View File

@@ -13,17 +13,17 @@ import (
. "github.com/tendermint/tendermint/binary"
. "github.com/tendermint/tendermint/blocks"
. "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/state"
)
type Mempool struct {
mtx sync.Mutex
lastBlock *Block
state *State
state *state.State
txs []Tx
}
func NewMempool(lastBlock *Block, state *State) *Mempool {
func NewMempool(lastBlock *Block, state *state.State) *Mempool {
return &Mempool{
lastBlock: lastBlock,
state: state,
@@ -45,7 +45,7 @@ func (mem *Mempool) AddTx(tx Tx) (err error) {
// Returns a new block from the current state and associated transactions.
// The block's Validation is empty, and some parts of the header too.
func (mem *Mempool) MakeProposalBlock() (*Block, *State) {
func (mem *Mempool) MakeProposalBlock() (*Block, *state.State) {
mem.mtx.Lock()
defer mem.mtx.Unlock()
nextBlock := mem.lastBlock.MakeNextBlock()
@@ -57,7 +57,7 @@ func (mem *Mempool) MakeProposalBlock() (*Block, *State) {
// "state" is the result of state.AppendBlock("block").
// Txs that are present in "block" are discarded from mempool.
// Txs that have become invalid in the new "state" are also discarded.
func (mem *Mempool) ResetForBlockAndState(block *Block, state *State) {
func (mem *Mempool) ResetForBlockAndState(block *Block, state *state.State) {
mem.mtx.Lock()
defer mem.mtx.Unlock()
mem.lastBlock = block