mirror of
https://github.com/monero-project/monero.git
synced 2025-06-08 00:42:44 -04:00
core: add functions to serialize base tx info
That is, information without signatures (for v1) nor range proofs and MGs (for v2)
This commit is contained in:
parent
6fd4b827fb
commit
f113b92b93
3 changed files with 33 additions and 0 deletions
|
@ -250,6 +250,28 @@ namespace cryptonote
|
|||
}
|
||||
END_SERIALIZE()
|
||||
|
||||
template<bool W, template <bool> class Archive>
|
||||
bool serialize_base(Archive<W> &ar)
|
||||
{
|
||||
FIELDS(*static_cast<transaction_prefix *>(this))
|
||||
|
||||
if (version == 1)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
ar.tag("rct_signatures");
|
||||
if (!vin.empty())
|
||||
{
|
||||
ar.begin_object();
|
||||
bool r = rct_signatures.serialize_rctsig_base(ar, vin.size(), vout.size());
|
||||
if (!r || !ar.stream().good()) return false;
|
||||
ar.end_object();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
static size_t get_signature_size(const txin_v& tx_in);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue