Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
cast n to usize
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege committed Jan 3, 2019
1 parent dc6acf4 commit b88c149
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ethcore/src/blockchain/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ impl BlockChain {
/// fetches the list of blocks from best block to n, and n's parent hash
/// where n > 0
pub fn block_headers_from_best_block(&self, n: u64) -> Option<(Vec<encoded::Header>, H256)> {
let mut blocks = Vec::with_capacity(n);
let mut blocks = Vec::with_capacity(n as usize);
let mut hash = self.best_block_hash();

for _ in 0..n {
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ impl BlockChainReset for Client {
.block_headers_from_best_block(num)
.ok_or("Attempted to reset past genesis block")?;

let mut db_transaction = DBTransaction::with_capacity(num as usize);
let mut db_transaction = DBTransaction::with_capacity((num + 1) as usize);

for hash in &blocks_to_delete {
db_transaction.delete(::db::COL_HEADERS, &hash.hash());
Expand Down

0 comments on commit b88c149

Please sign in to comment.