From 138bcf7855180bffd2d21b30db45e219aef8eece Mon Sep 17 00:00:00 2001 From: Jianping Wu Date: Wed, 13 Mar 2019 16:30:20 -0700 Subject: [PATCH] Fixed auxpow parsing. --- src/rpc/mining.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 5796433a2..31ca43fc9 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -643,8 +643,14 @@ UniValue submitblock(const JSONRPCRequest& request) if (request.params[1].getType() != UniValue::VSTR) { throw JSONRPCError(RPC_INVALID_PARAMETER, "auxpow must be string type"); } + + cryptonote::blobdata auxblob; + if(!epee::string_tools::parse_hexstr_to_binbuff(request.params[1].get_str(), auxblob)) { + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Wrong block blob"); + } + std::stringstream ss; - ss << request.params[1].get_str(); + ss << auxblob; // load binary_archive ba(ss); auxPow = std::shared_ptr(new CAuxPow());