diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-10-08 15:55:03 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-10-08 15:55:03 -0500 |
commit | bf525793c724f62d4716aaca59345ba2e13a2c3c (patch) | |
tree | ad7ea60c6faf8ca103a686529fc1c716e272a9a5 /src/serialization/json_object.cpp | |
parent | Merge pull request #5960 (diff) | |
parent | monerod can now sync from pruned blocks (diff) | |
download | monero-bf525793c724f62d4716aaca59345ba2e13a2c3c.tar.xz |
Merge pull request #5915
8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
Diffstat (limited to 'src/serialization/json_object.cpp')
-rw-r--r-- | src/serialization/json_object.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/serialization/json_object.cpp b/src/serialization/json_object.cpp index cc52bde58..42d09aa5f 100644 --- a/src/serialization/json_object.cpp +++ b/src/serialization/json_object.cpp @@ -627,6 +627,25 @@ void fromJsonValue(const rapidjson::Value& val, cryptonote::connection_info& inf GET_FROM_JSON_OBJECT(val, info.current_upload, current_upload); } +void toJsonValue(rapidjson::Document& doc, const cryptonote::tx_blob_entry& tx, rapidjson::Value& val) +{ + val.SetObject(); + + INSERT_INTO_JSON_OBJECT(val, doc, blob, tx.blob); + INSERT_INTO_JSON_OBJECT(val, doc, prunable_hash, tx.prunable_hash); +} + +void fromJsonValue(const rapidjson::Value& val, cryptonote::tx_blob_entry& tx) +{ + if (!val.IsObject()) + { + throw WRONG_TYPE("json object"); + } + + GET_FROM_JSON_OBJECT(val, tx.blob, blob); + GET_FROM_JSON_OBJECT(val, tx.prunable_hash, prunable_hash); +} + void toJsonValue(rapidjson::Document& doc, const cryptonote::block_complete_entry& blk, rapidjson::Value& val) { val.SetObject(); |