From b7b2d9656326de864542c521052df5fcc119d0f7 Mon Sep 17 00:00:00 2001 From: Nchinda Nchinda Date: Sun, 7 Jan 2018 21:04:54 -0500 Subject: [PATCH] convert addresses to lower case when storing 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. --- lib/keystore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/keystore.js b/lib/keystore.js index 423b47c1..4dd02db7 100644 --- a/lib/keystore.js +++ b/lib/keystore.js @@ -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'); }