Merge branch 'master' into reorgjdb

This commit is contained in:
Nikolay Volf 2016-03-11 20:05:41 +04:00
commit 87fb0b31eb
5 changed files with 9 additions and 8 deletions

View File

@ -34,9 +34,6 @@ Then, download and build Parity:
git clone https://github.com/ethcore/parity
cd parity
# parity should be built with rust beta
multirust override beta
# build in release mode
cargo build --release
```

View File

@ -1307,11 +1307,11 @@ impl ChainSync {
}
/// Add transaction to the transaction queue
pub fn insert_transaction<T>(&self, transaction: ethcore::transaction::SignedTransaction, fetch_nonce: &T)
pub fn insert_transaction<T>(&self, transaction: ethcore::transaction::SignedTransaction, fetch_nonce: &T) -> Result<(), Error>
where T: Fn(&Address) -> U256
{
let mut queue = self.transaction_queue.lock().unwrap();
queue.add(transaction, fetch_nonce);
queue.add(transaction, fetch_nonce)
}
}

View File

@ -146,7 +146,8 @@ impl SyncProvider for EthSync {
let nonce_fn = |a: &Address| self.chain.state().nonce(a) + U256::one();
let sync = self.sync.write().unwrap();
sync.insert_transaction(transaction, &nonce_fn);
sync.insert_transaction(transaction, &nonce_fn).unwrap_or_else(
|e| warn!(target: "sync", "Error inserting transaction to queue: {:?}", e));
}
}

View File

@ -684,8 +684,8 @@ mod test {
let mut txq = TransactionQueue::new();
let (tx, tx2) = new_txs(U256::from(1));
txq.add(tx.clone(), &prev_nonce);
txq.add(tx2.clone(), &prev_nonce);
txq.add(tx.clone(), &prev_nonce).unwrap();
txq.add(tx2.clone(), &prev_nonce).unwrap();
assert_eq!(txq.status().future, 2);
// when

View File

@ -36,6 +36,9 @@
//! The functions here are designed to be fast.
//!
#[cfg(all(asm_available, target_arch="x86_64"))]
use std::mem;
use std::fmt;
use std::cmp;