Skip to content

Commit

Permalink
fix eth checksum addr (#2028)
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother authored Jun 6, 2023
1 parent 21b837e commit 81a95ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ffi/ffiexports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ uint64_t getMinRelayTxFee() {
}

std::array<uint8_t, 32> getEthPrivKey(std::array<uint8_t, 20> keyID) {
CKey ethPrivKey;
const auto ethKeyID = CKeyID{uint160{std::vector<uint8_t>(keyID.begin(), keyID.end())}};
for (const auto &wallet : GetWallets()) {
const auto ethKeyID = CKeyID{uint160{std::vector<uint8_t>(keyID.begin(), keyID.end())}};
CKey ethPrivKey;
if (wallet->GetEthKey(ethKeyID, ethPrivKey)) {
std::array<uint8_t, 32> privKeyArray{};
std::copy(ethPrivKey.begin(), ethPrivKey.end(), privKeyArray.begin());
Expand Down
2 changes: 1 addition & 1 deletion src/key_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class DestinationEncoder
{
// Raw addr = ETH_ADDR_PREFIX + HexStr(id);
// Produce ETH checksum address: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md
const auto address = id.ToString();
const auto address = HexStr(id);
std::vector<unsigned char> input(address.begin(), address.end());
std::vector<unsigned char> output;
sha3(input, output);
Expand Down

0 comments on commit 81a95ba

Please sign in to comment.