Differentiate between ClosedBlock (can be reopened) and LockedBlock (cannot).

`ClosedBlock`s still keep the pre-finalised state (i.e. state after the last transaction).
`LockedBlock`s do not. New mining algo needs to reopen these `ClosedBlock`s, however enactment
system does not (and `ClosedBlock`s are slower & more hungry), hence the distinction.
This commit is contained in:
Gav Wood
2016-03-27 20:33:23 +02:00
parent 6cac296366
commit 7c5b171e3f
6 changed files with 85 additions and 28 deletions

View File

@@ -29,7 +29,7 @@ use extras::BlockReceipts;
use error::{ImportResult};
use block_queue::BlockQueueInfo;
use block::{SealedBlock, ClosedBlock};
use block::{SealedBlock, ClosedBlock, LockedBlock};
use executive::Executed;
use error::Error;
use engine::Engine;
@@ -262,7 +262,7 @@ impl BlockChainClient for TestBlockChainClient {
(None, HashSet::new())
}
fn try_seal(&self, block: ClosedBlock, _seal: Vec<Bytes>) -> Result<SealedBlock, ClosedBlock> {
fn try_seal(&self, block: LockedBlock, _seal: Vec<Bytes>) -> Result<SealedBlock, LockedBlock> {
Err(block)
}