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

Commit

Permalink
Don't panic if extra_data is longer than VANITY_LENGTH (#10682)
Browse files Browse the repository at this point in the history
* Don't panic if extra_data is longer than VANITY_LENGTH

Seems like `extra_data().len()` can be longer than 32 (was 39 here) so this fixes that panic.

* Update ethcore/src/engines/clique/mod.rs
  • Loading branch information
dvdplm authored and ordian committed May 22, 2019
1 parent 8998774 commit 26d1303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ethcore/src/engines/clique/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ impl Engine<EthereumMachine> for Clique {
}
}

let zero_padding_len = VANITY_LENGTH - header.extra_data().len();
let zero_padding_len = VANITY_LENGTH.saturating_sub(header.extra_data().len());
if zero_padding_len > 0 {
let mut resized_extra_data = header.extra_data().clone();
resized_extra_data.resize(VANITY_LENGTH, 0);
Expand Down

0 comments on commit 26d1303

Please sign in to comment.