Less cloning when importing blocks (#11531)

* WIP

* cleanup

* check_and_lock_block() only needs reference

* Cleanup&docs

* Push uncles by ref to clone at the last possible time.

* Missing import

* Review grumbles

* Update util/journaldb/src/overlayrecentdb.rs

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Update ethcore/types/src/client_types.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* deref U256 before adding

* More review grumbles

* review grumbles: pass by value

* cleanup

* Move the block

* Don't clone the header

* Update ethcore/src/client/client.rs

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Update ethcore/src/client/client.rs

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Add comment

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
David
2020-03-04 18:34:29 +01:00
committed by GitHub
parent 729b10e1e0
commit 6c0134f2ee
12 changed files with 97 additions and 120 deletions

View File

@@ -1069,8 +1069,8 @@ impl BlockChain {
}
/// Write a pending epoch transition by block hash.
pub fn insert_pending_transition(&self, batch: &mut DBTransaction, hash: H256, t: PendingEpochTransition) {
batch.write(db::COL_EXTRA, &hash, &t);
pub fn insert_pending_transition(&self, batch: &mut DBTransaction, hash: &H256, t: PendingEpochTransition) {
batch.write(db::COL_EXTRA, hash, &t);
}
/// Get a pending epoch transition by block hash.