Use transaction for writing blocks (#1718)
This commit is contained in:
parent
67a9a40243
commit
22a87b1203
@ -329,7 +329,9 @@ impl BlockChain {
|
|||||||
children: vec![]
|
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();
|
let batch = DBTransaction::new();
|
||||||
batch.write(&hash, &details);
|
batch.write(&hash, &details);
|
||||||
|
Loading…
Reference in New Issue
Block a user