Skip to content

Commit

Permalink
fix error also return ok 84
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyShi22 committed Jan 11, 2024
1 parent 2274a5a commit d1eda97
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bcos-executor/src/vm/Precompiled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,16 @@ pair<bool, bytes> ecRecover(bytesConstRef _in)
crypto::HashType mHash;
memcpy(mHash.data(), _in.data(), crypto::HashType::SIZE);

auto pk = crypto::secp256k1Recover(mHash, bytesConstRef(rawRSV, RSV_LENGTH));
PublicPtr pk;
try
{
pk = crypto::secp256k1Recover(mHash, bytesConstRef(rawRSV, RSV_LENGTH));
}
catch (...)
{
// is also ok and return 0x0000000000000000000000000000000000000084
return {true, {}};
}

pair<bool, bytes> ret{true, bytes(crypto::HashType::SIZE, 0)};
BCOS_LOG(TRACE) << LOG_BADGE("Precompiled") << LOG_DESC("wedpr_secp256k1_recover_public_key")
Expand Down

0 comments on commit d1eda97

Please sign in to comment.