Fix empty candidate txs (#1168)

This commit is contained in:
Quentin Le Sceller 2018-06-14 13:37:21 -04:00 committed by Ignotus Peverell
parent 9e0b3b6862
commit c412bc6c60

View file

@ -102,7 +102,10 @@ where
.filter(|x| x.state == from_state) .filter(|x| x.state == from_state)
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let candidate_txs = entries.iter().map(|x| x.tx.clone()).collect(); let candidate_txs: Vec<Transaction> = entries.iter().map(|x| x.tx.clone()).collect();
if candidate_txs.is_empty() {
return Ok(vec![]);
}
let valid_txs = self.blockchain.validate_raw_txs(candidate_txs, extra_tx)?; let valid_txs = self.blockchain.validate_raw_txs(candidate_txs, extra_tx)?;
// Update state on all entries included in final vec of valid txs. // Update state on all entries included in final vec of valid txs.