Adding transactions to block
This commit is contained in:
@@ -1270,6 +1270,10 @@ impl ChainSync {
|
||||
// TODO [todr] propagate transactions?
|
||||
}
|
||||
|
||||
pub fn chain_new_head(&mut self, io: &mut SyncIo) {
|
||||
self.miner.prepare_sealing(io.chain());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -158,6 +158,10 @@ impl NetworkProtocolHandler<SyncMessage> for EthSync {
|
||||
let mut sync_io = NetSyncIo::new(io, self.chain.deref());
|
||||
self.sync.write().unwrap().chain_new_blocks(&mut sync_io, good, bad, retracted);
|
||||
},
|
||||
SyncMessage::NewChainHead => {
|
||||
let mut sync_io = NetSyncIo::new(io, self.chain.deref());
|
||||
self.sync.write().unwrap().chain_new_head(&mut sync_io);
|
||||
}
|
||||
_ => {/* Ignore other messages */},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ use io::SyncIo;
|
||||
use chain::ChainSync;
|
||||
use ::SyncConfig;
|
||||
use ethcore::receipt::Receipt;
|
||||
use ethcore::transaction::{LocalizedTransaction, Transaction, Action};
|
||||
use ethcore::transaction::{LocalizedTransaction, SignedTransaction, Transaction, Action};
|
||||
use ethcore::filter::Filter;
|
||||
use ethcore::log_entry::LocalizedLogEntry;
|
||||
|
||||
@@ -311,7 +311,7 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
}
|
||||
}
|
||||
|
||||
fn prepare_sealing(&self, author: Address, extra_data: Bytes) -> Option<ClosedBlock> {
|
||||
fn prepare_sealing(&self, author: Address, extra_data: Bytes, transactions: Vec<SignedTransaction>) -> Option<ClosedBlock> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user