cryptonote: add a set_null for transaction_prefix

Since it's all inline, I suspect the compiler will merge the
duplicate stores anyway.
This commit is contained in:
moneromooo-monero 2018-11-30 14:54:46 +00:00
parent 58ce16d4d9
commit 0c5dd3161b
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -175,7 +175,15 @@ namespace cryptonote
END_SERIALIZE()
public:
transaction_prefix(){}
transaction_prefix(){ set_null(); }
void set_null()
{
version = 1;
unlock_time = 0;
vin.clear();
vout.clear();
extra.clear();
}
};
class transaction: public transaction_prefix
@ -302,17 +310,12 @@ namespace cryptonote
inline
transaction::~transaction()
{
//set_null();
}
inline
void transaction::set_null()
{
version = 1;
unlock_time = 0;
vin.clear();
vout.clear();
extra.clear();
transaction_prefix::set_null();
signatures.clear();
rct_signatures.type = rct::RCTTypeNull;
set_hash_valid(false);