未验证 提交 855583ef 编写于 作者: K Kevin Heifner 提交者: GitHub

Merge pull request #3077 from ProChain/master

delete unneccesary assert
......@@ -90,16 +90,14 @@ namespace fc { namespace crypto {
static private_key::storage_type parse_base58(const string& base58str)
{
if (base58str.find('_') == std::string::npos) {
const auto pivot = base58str.find('_');
if (pivot == std::string::npos) {
// wif import
using default_type = private_key::storage_type::template type_at<0>;
return private_key::storage_type(from_wif<default_type>(base58str));
} else {
constexpr auto prefix = config::private_key_base_prefix;
const auto pivot = base58str.find('_');
FC_ASSERT(pivot != std::string::npos, "No delimiter in string, cannot determine type: ${str}", ("str", base58str));
const auto prefix_str = base58str.substr(0, pivot);
FC_ASSERT(prefix == prefix_str, "Private Key has invalid prefix: ${str}", ("str", base58str)("prefix_str", prefix_str));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册