| 31 | } |
| 32 | |
| 33 | bool CKeyCombi::UnSerializeFromJson(const Object& obj) { |
| 34 | try { |
| 35 | Object reply; |
| 36 | const Value& mCKey = find_value(obj, "mCkey"); |
| 37 | if (mCKey.type() != json_spirit::null_type) { |
| 38 | auto const& tem1 = ::ParseHex(mCKey.get_str()); |
| 39 | mMainCkey.Set(tem1.begin(), tem1.end(), true); |
| 40 | } |
| 41 | const Value& mMinerKey = find_value(obj, "mMinerCkey"); |
| 42 | if (mMinerKey.type() != json_spirit::null_type) { |
| 43 | auto const& tem2 = ::ParseHex(mMinerKey.get_str()); |
| 44 | mMinerCkey.Set(tem2.begin(), tem2.end(), true); |
| 45 | } |
| 46 | const Value& nTime = find_value(obj, "nCreationTime").get_int64(); |
| 47 | if (nTime.type() != json_spirit::null_type) { |
| 48 | nCreationTime = find_value(obj, "nCreationTime").get_int64(); |
| 49 | } |
| 50 | } catch (...) { |
| 51 | ERRORMSG("UnSerializeFromJson Failed !"); |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | bool CKeyCombi::CleanAll() { |
| 59 | mMainCkey.Clear(); |