exposing only one func
This commit is contained in:
parent
ddc3440712
commit
a2046b429f
@ -43,6 +43,7 @@ use io::SyncIo;
|
||||
use transaction_queue::TransactionQueue;
|
||||
use time;
|
||||
use super::SyncConfig;
|
||||
use ethcore;
|
||||
|
||||
known_heap_size!(0, PeerInfo, Header, HeaderId);
|
||||
|
||||
@ -1300,8 +1301,12 @@ impl ChainSync {
|
||||
// TODO [todr] propagate transactions?
|
||||
}
|
||||
|
||||
pub fn transaction_queue(&self) -> &Mutex<TransactionQueue> {
|
||||
return &self.transaction_queue;
|
||||
/// Add transaction to the transaction queue
|
||||
pub fn insert_transaction<T>(&self, transaction: ethcore::transaction::SignedTransaction, fetch_nonce: &T)
|
||||
where T: Fn(&Address) -> U256
|
||||
{
|
||||
let mut queue = self.transaction_queue.lock().unwrap();
|
||||
queue.add(transaction, fetch_nonce);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,8 +135,7 @@ impl EthSync {
|
||||
|
||||
let nonce_fn = |a: &Address| self.chain.state().nonce(a) + U256::one();
|
||||
let sync = self.sync.write().unwrap();
|
||||
let mut queue = sync.transaction_queue().lock().unwrap();
|
||||
queue.add(transaction, &nonce_fn);
|
||||
sync.insert_transaction(transaction, &nonce_fn);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user