Use transaction for writing blocks (#1718)

This commit is contained in:
Arkadiy Paronyan 2016-07-26 00:25:49 +02:00 committed by Gav Wood
parent 67a9a40243
commit 22a87b1203

View File

@ -329,7 +329,9 @@ impl BlockChain {
children: vec![]
};
bc.blocks_db.put(&hash, genesis).unwrap();
let block_batch = DBTransaction::new();
block_batch.put(&hash, genesis).unwrap();
bc.blocks_db.write(block_batch).expect("Low level database error. Some issue with disk?");
let batch = DBTransaction::new();
batch.write(&hash, &details);