Merge pull request #1604 from ethereum/checksums

Warn about invalid checksums of addresses.
This commit is contained in:
Alex Beregszaszi
2017-01-26 14:42:34 +00:00
committed by GitHub
15 changed files with 294 additions and 18 deletions
+5
View File
@@ -436,6 +436,11 @@ bool CommandLineInterface::parseLibraryOption(string const& _input)
string addrString(lib.begin() + colon + 1, lib.end());
boost::trim(libName);
boost::trim(addrString);
if (!passesAddressChecksum(addrString, false))
{
cerr << "Invalid checksum on library address \"" << libName << "\": " << addrString << endl;
return false;
}
bytes binAddr = fromHex(addrString);
h160 address(binAddr, h160::AlignRight);
if (binAddr.size() > 20 || address == h160())