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

Don't panic if extra_data is longer than VANITY_LENGTH #10682

Merged
merged 2 commits into from
May 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.checked_sub(header.extra_data().len()).unwrap_or(0);
dvdplm marked this conversation as resolved.
Show resolved Hide resolved
if zero_padding_len > 0 {
let mut resized_extra_data = header.extra_data().clone();
resized_extra_data.resize(VANITY_LENGTH, 0);
Expand Down