Skip to content

Commit

Permalink
convert addresses to lower case when storing
Browse files Browse the repository at this point in the history
Some sources encode a checksum into the capitalization of the ethereum address, this causes exportPrivateKey to fail as the stored addresses are all lower case.
  • Loading branch information
Firescar96 authored Jan 8, 2018
1 parent c11221f commit b7b2d96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/keystore.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ KeyStore.prototype.exportPrivateKey = function (address, pwDerivedKey) {
throw new Error("Incorrect derived key!");
}

var address = strip0x(address);
var address = strip0x(address).toLowerCase();
if (this.encPrivKeys[address] === undefined) {
throw new Error('KeyStore.exportPrivateKey: Address not found in KeyStore');
}
Expand Down

0 comments on commit b7b2d96

Please sign in to comment.