Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
struct CCoin { | struct CCoin { | ||||
uint32_t nHeight; | uint32_t nHeight; | ||||
CTxOut out; | CTxOut out; | ||||
CCoin() : nHeight(0) {} | CCoin() : nHeight(0) {} | ||||
explicit CCoin(Coin in) | explicit CCoin(Coin in) | ||||
: nHeight(in.GetHeight()), out(std::move(in.GetTxOut())) {} | : nHeight(in.GetHeight()), out(std::move(in.GetTxOut())) {} | ||||
ADD_SERIALIZE_METHODS; | SERIALIZE_METHODS(CCoin, obj) { | ||||
template <typename Stream, typename Operation> | |||||
inline void SerializationOp(Stream &s, Operation ser_action) { | |||||
uint32_t nTxVerDummy = 0; | uint32_t nTxVerDummy = 0; | ||||
READWRITE(nTxVerDummy); | READWRITE(nTxVerDummy, obj.nHeight, obj.out); | ||||
READWRITE(nHeight); | |||||
READWRITE(out); | |||||
} | } | ||||
}; | }; | ||||
static bool RESTERR(HTTPRequest *req, enum HTTPStatusCode status, | static bool RESTERR(HTTPRequest *req, enum HTTPStatusCode status, | ||||
std::string message) { | std::string message) { | ||||
req->WriteHeader("Content-Type", "text/plain"); | req->WriteHeader("Content-Type", "text/plain"); | ||||
req->WriteReply(status, message + "\r\n"); | req->WriteReply(status, message + "\r\n"); | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 709 Lines • Show Last 20 Lines |