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

Conversation

debris
Copy link
Collaborator

@debris debris commented Oct 1, 2018

No description provided.

@debris debris added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Oct 1, 2018
bail!(EthcoreErrorKind::Block(BlockError::UnknownParent(unverified.parent_hash())));
}

let raw = unverified.bytes.clone();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant block clone

@5chdn 5chdn added this to the 2.2 milestone Oct 1, 2018
Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another approach would be to move let raw = unverified.bytes.clone(); under bad_block reporting match, it would be ok, since it's not a common path.

// we only care about block errors (not import errors)
Err(EthcoreError(EthcoreErrorKind::Block(err), _))=> {
self.importer.bad_blocks.report(raw, format!("{:?}", err));
Err((block, EthcoreError(EthcoreErrorKind::Block(err), _)))=> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space before =>

@ordian ordian added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Oct 1, 2018
@sorpaas sorpaas merged commit 5a2f3e7 into master Oct 3, 2018
@sorpaas sorpaas deleted the remove-block-clone branch October 3, 2018 17:45
@debris
Copy link
Collaborator Author

debris commented Oct 4, 2018

Another approach would be to move let raw = unverified.bytes.clone(); under bad_block reporting match, it would be ok, since it's not a common path.

@ordian you cannot do that cause unverified is already moved to a different context

dvdplm added a commit that referenced this pull request Oct 9, 2018
…mon-deps

* origin/master:
  fix (light/provider) : Make `read_only executions` read-only (#9591)
  ethcore: fix detection of major import (#9552)
  return 0 on error (#9705)
  ethcore: delay ropsten hardfork (#9704)
  make instantSeal engine backwards compatible, closes #9696 (#9700)
  Implement CREATE2 gas changes and fix some potential overflowing (#9694)
  Don't hash the init_code of CREATE. (#9688)
  ethcore: minor optimization of modexp by using LR exponentiation (#9697)
  removed redundant clone before each block import (#9683)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants