Skip to content

Commit

Permalink
util: Remove obsolete check in addr conversions (#2608)
Browse files Browse the repository at this point in the history
* rpc: addressmap: Better error messages

* rpc: addressmap: add erc55 validity check

* Add const

* util: Remove obsolete check

---------

Co-authored-by: Peter John Bushnell <[email protected]>
  • Loading branch information
prasannavl and Bushstar authored Oct 23, 2023
1 parent 8597e7d commit e599f2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/rpc/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ CPubKey AddrToPubKey(FillableSigningProvider* const keystore, const std::string&
if (!keystore->GetPubKey(key, vchPubKey)) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("no full public key for address %s", addr_in));
}
if (dest.index() == WitV16KeyEthHashType && vchPubKey.IsCompressed()) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("no valid public key for address %s", addr_in));
}
if (!vchPubKey.IsFullyValid()) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet contains an invalid public key");
}
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4322,7 +4322,7 @@ UniValue addressmap(const JSONRPCRequest &request) {
if (key.IsCompressed()) {
key.Decompress();
}
auto erc55 = EncodeDestination(WitnessV16EthHash(key));
const auto erc55 = EncodeDestination(WitnessV16EthHash(key));
// Check if it's in the wallet.
// Note: Can be removed if the full wallet is migrated.
// Ref: https://github.com/DeFiCh/ain/issues/2604
Expand Down

0 comments on commit e599f2f

Please sign in to comment.