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

Commit

Permalink
Fix the brainwallet functionality. (#2994) (#3005)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkpar authored and gavofyork committed Oct 31, 2016
1 parent 54da6ae commit 93327e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ethkey/src/brain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

use keccak::Keccak256;
use super::{KeyPair, Error, Generator, Secret};
use super::{KeyPair, Error, Generator};

/// Simple brainwallet.
pub struct Brain(String);
Expand All @@ -38,9 +38,9 @@ impl Generator for Brain {
match i > 16384 {
false => i += 1,
true => {
let result = KeyPair::from_secret(Secret::from(secret.clone()));
if result.is_ok() {
return result
let result = KeyPair::from_secret(secret.clone().into());
if result.as_ref().ok().map_or(false, |r| r.address()[0] == 0) {
return result;
}
},
}
Expand Down

0 comments on commit 93327e8

Please sign in to comment.