Set timestamp in enactment.

This commit is contained in:
Gav Wood 2016-01-10 22:57:31 +01:00
parent 74f88f9b9b
commit abb4975400
2 changed files with 2 additions and 1 deletions

View File

@ -250,6 +250,7 @@ pub fn enacted(rlp_bytes: &[u8], db: OverlayDB, engine: &Engine, parent: &Header
let block = BlockView::new(rlp_bytes); let block = BlockView::new(rlp_bytes);
let header = block.header_view(); let header = block.header_view();
let mut b = OpenBlock::new(engine, db, parent, last_hashes, header.author(), header.extra_data()); let mut b = OpenBlock::new(engine, db, parent, last_hashes, header.author(), header.extra_data());
b.set_timestamp(header.timestamp());
for t in block.transactions().into_iter() { try!(b.push_transaction(t, None)); } for t in block.transactions().into_iter() { try!(b.push_transaction(t, None)); }
for u in block.uncles().into_iter() { try!(b.push_uncle(u)); } for u in block.uncles().into_iter() { try!(b.push_uncle(u)); }
Ok(try!(b.close().seal(header.seal()))) Ok(try!(b.close().seal(header.seal())))

View File

@ -122,7 +122,7 @@ impl<'a> HeaderView<'a> {
pub fn gas_used(&self) -> U256 { self.rlp.val_at(10) } pub fn gas_used(&self) -> U256 { self.rlp.val_at(10) }
/// Returns timestamp. /// Returns timestamp.
pub fn timestamp(&self) -> usize { self.rlp.val_at(11) } pub fn timestamp(&self) -> u64 { self.rlp.val_at(11) }
/// Returns block extra data. /// Returns block extra data.
pub fn extra_data(&self) -> Bytes { self.rlp.val_at(12) } pub fn extra_data(&self) -> Bytes { self.rlp.val_at(12) }