mempool tests

This commit is contained in:
Ethan Buchman
2015-09-29 11:36:52 -04:00
parent 12566f51af
commit cccb722ba8
6 changed files with 324 additions and 15 deletions

View File

@ -39,6 +39,12 @@ func (mem *Mempool) GetCache() *sm.BlockCache {
return mem.cache
}
func (mem *Mempool) GetHeight() int {
mem.mtx.Lock()
defer mem.mtx.Unlock()
return mem.state.LastBlockHeight
}
// Apply tx to the state and remember it.
func (mem *Mempool) AddTx(tx types.Tx) (err error) {
mem.mtx.Lock()