33#include <boost/variant.hpp>
34#include <boost/functional/hash/hash.hpp>
63 std::vector<crypto::public_key>
keys;
243 if (!typename Archive<W>::is_saving())
262 ar.tag(
"signatures");
265 bool signatures_not_expected =
signatures.empty();
269 if (!
pruned)
for (
size_t i = 0; i <
vin.size(); ++i)
272 if (signatures_not_expected)
274 if (0 == signature_size)
286 if (
vin.size() - i > 1)
293 ar.tag(
"rct_signatures");
298 if (!r || !
ar.good())
return false;
306 ar.tag(
"rctsig_prunable");
309 vin.size() > 0 &&
vin[0].type() ==
typeid(
txin_to_key) ? boost::get<txin_to_key>(
vin[0]).key_offsets.size() - 1 : 0);
310 if (!r || !
ar.good())
return false;
315 if (!
typename Archive<W>::is_saving())
319 template<
bool W, template <
bool> class Archive>
329 ar.tag(
"rct_signatures");
334 if (!r || !
ar.good())
return false;
338 if (!
typename Archive<W>::is_saving())
344 static size_t get_signature_size(
const txin_v& tx_in);
358 if (t.is_hash_valid())
361 set_hash_valid(true);
363 if (t.is_blob_size_valid())
365 blob_size = t.blob_size;
366 set_blob_size_valid(true);
368 if (t.is_prunable_hash_valid())
370 prunable_hash = t.prunable_hash;
371 set_prunable_hash_valid(true);
377 transaction_prefix::operator=(t);
384 if (t.is_hash_valid())
389 if (t.is_prunable_hash_valid())
394 if (t.is_blob_size_valid())
441 struct txin_signature_size_visitor :
public boost::static_visitor<size_t>
443 size_t operator()(
const txin_gen& txin)
const{
return 0;}
449 return boost::apply_visitor(txin_signature_size_visitor(), tx_in);
496 if (!typename Archive<W>::is_saving())
534 return !(*
this == rhs);
cryptonote::block b
Definition block.cpp:40
static uint64_t h
Definition blockchain_stats.cpp:55
std::vector< uint8_t > extra
Definition cryptonote_basic.h:181
if(version==0||CURRENT_TRANSACTION_VERSION< version) return false
std::vector< txin_v > vin
Definition cryptonote_basic.h:178
size_t version
Definition cryptonote_basic.h:175
transaction_prefix()
Definition cryptonote_basic.h:193
void set_null()
Definition cryptonote_basic.h:194
std::vector< tx_out > vout
Definition cryptonote_basic.h:179
uint64_t unlock_time
Definition cryptonote_basic.h:176
Definition cryptonote_basic.h:205
const auto start_pos
Definition cryptonote_basic.h:250
bool is_hash_valid() const
Definition cryptonote_basic.h:232
bool is_prunable_hash_valid() const
Definition cryptonote_basic.h:234
rct::rctSig rct_signatures
Definition cryptonote_basic.h:214
std::atomic< bool > blob_size_valid
Definition cryptonote_basic.h:210
void set_null()
Definition cryptonote_basic.h:417
transaction()
Definition cryptonote_basic.h:406
void set_blob_size(size_t sz) const
Definition cryptonote_basic.h:240
std::atomic< unsigned int > unprunable_size
Definition cryptonote_basic.h:223
void set_prunable_hash(const crypto::hash &h) const
Definition cryptonote_basic.h:239
std::atomic< unsigned int > prefix_size
Definition cryptonote_basic.h:224
bool pruned
Definition cryptonote_basic.h:221
void set_hash(const crypto::hash &h) const
Definition cryptonote_basic.h:238
void set_hash_valid(bool v) const
Definition cryptonote_basic.h:233
bool serialize_base(Archive< W > &ar)
Definition cryptonote_basic.h:320
static size_t get_signature_size(const txin_v &tx_in)
Definition cryptonote_basic.h:439
if(!typename Archive< W >::is_saving())
Definition cryptonote_basic.h:243
void set_prunable_hash_valid(bool v) const
Definition cryptonote_basic.h:235
transaction & operator=(const transaction &t)
Definition cryptonote_basic.h:375
std::atomic< bool > prunable_hash_valid
Definition cryptonote_basic.h:209
crypto::hash prunable_hash
Definition cryptonote_basic.h:218
std::vector< std::vector< crypto::signature > > signatures
Definition cryptonote_basic.h:213
void invalidate_hashes()
Definition cryptonote_basic.h:431
virtual ~transaction()
Definition cryptonote_basic.h:412
size_t blob_size
Definition cryptonote_basic.h:219
void set_blob_size_valid(bool v) const
Definition cryptonote_basic.h:237
crypto::hash hash
Definition cryptonote_basic.h:217
bool is_blob_size_valid() const
Definition cryptonote_basic.h:236
std::atomic< bool > hash_valid
Definition cryptonote_basic.h:208
virtual crypto::secret_key generate_keys(crypto::public_key &pub, crypto::secret_key &sec, const crypto::secret_key &recovery_key=crypto::secret_key(), bool recover=false)=0
binary_archive< false > ar
Definition cold-outputs.cpp:54
#define CRYPTONOTE_MAX_TX_PER_BLOCK
Definition cryptonote_config.h:42
#define CURRENT_TRANSACTION_VERSION
Definition cryptonote_config.h:45
#define BEGIN_SERIALIZE()
#define BEGIN_SERIALIZE_OBJECT()
#define BLOB_SERIALIZER(T)
#define PREPARE_CUSTOM_VECTOR_SERIALIZATION(size, vec)
#define VARIANT_TAG(Archive, Type, Tag)
const char * res
Definition hmac_keccak.cpp:42
#define const
Definition ipfrdr.c:80
#define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE(varialble)
Definition keyvalue_serialization.h:123
#define END_KV_SERIALIZE_MAP()
Definition keyvalue_serialization.h:118
#define BEGIN_KV_SERIALIZE_MAP()
Definition keyvalue_serialization.h:43
Definition portable_binary_archive.hpp:29
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition crypto.h:72
POD_CLASS view_tag
Definition crypto.h:103
POD_CLASS public_key
Definition crypto.h:64
POD_CLASS key_image
Definition crypto.h:95
POD_CLASS hash
Definition hash.h:49
Holds cryptonote related classes and helpers.
Definition blockchain_db.cpp:45
boost::variant< txout_to_script, txout_to_scripthash, txout_to_key, txout_to_tagged_key > txout_target_v
Definition cryptonote_basic.h:154
boost::variant< txin_gen, txin_to_script, txin_to_scripthash, txin_to_key > txin_v
Definition cryptonote_basic.h:152
std::vector< crypto::signature > ring_signature
Definition cryptonote_basic.h:56
@ RCTTypeNull
Definition rctTypes.h:299
unsigned int uint32_t
Definition stdint.h:126
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
Definition binary_archive.h:89
Definition cryptonote_basic.h:512
crypto::public_key m_view_public_key
Definition cryptonote_basic.h:514
bool operator!=(const account_public_address &rhs) const
Definition cryptonote_basic.h:532
crypto::public_key m_spend_public_key
Definition cryptonote_basic.h:513
Definition cryptonote_basic.h:475
transaction miner_tx
Definition cryptonote_basic.h:489
void set_hash(const crypto::hash &h) const
Definition cryptonote_basic.h:487
void invalidate_hashes()
Definition cryptonote_basic.h:484
block()
Definition cryptonote_basic.h:481
crypto::hash hash
Definition cryptonote_basic.h:493
block & operator=(const block &b)
Definition cryptonote_basic.h:483
bool is_hash_valid() const
Definition cryptonote_basic.h:485
void set_hash_valid(bool v) const
Definition cryptonote_basic.h:486
block(const block &b)
Definition cryptonote_basic.h:482
std::vector< crypto::hash > tx_hashes
Definition cryptonote_basic.h:490
if(!typename Archive< W >::is_saving()) set_hash_valid(false)
std::atomic< bool > hash_valid
Definition cryptonote_basic.h:478
Definition cryptonote_basic.h:539
crypto::secret_key sec
Definition cryptonote_basic.h:541
static keypair generate(hw::device &hwdev)
Definition cryptonote_basic.h:543
crypto::public_key pub
Definition cryptonote_basic.h:540
Definition cryptonote_basic.h:158
txout_target_v target
Definition cryptonote_basic.h:160
uint64_t amount
Definition cryptonote_basic.h:159
Definition cryptonote_basic.h:102
size_t height
Definition cryptonote_basic.h:103
Definition cryptonote_basic.h:139
crypto::key_image k_image
Definition cryptonote_basic.h:142
std::vector< uint64_t > key_offsets
Definition cryptonote_basic.h:141
uint64_t amount
Definition cryptonote_basic.h:140
Definition cryptonote_basic.h:111
crypto::hash prev
Definition cryptonote_basic.h:112
std::vector< uint8_t > sigset
Definition cryptonote_basic.h:114
size_t prevout
Definition cryptonote_basic.h:113
Definition cryptonote_basic.h:124
size_t prevout
Definition cryptonote_basic.h:126
std::vector< uint8_t > sigset
Definition cryptonote_basic.h:128
txout_to_script script
Definition cryptonote_basic.h:127
crypto::hash prev
Definition cryptonote_basic.h:125
Definition cryptonote_basic.h:79
crypto::public_key key
Definition cryptonote_basic.h:82
txout_to_key()
Definition cryptonote_basic.h:80
txout_to_key(const crypto::public_key &_key)
Definition cryptonote_basic.h:81
Definition cryptonote_basic.h:62
std::vector< crypto::public_key > keys
Definition cryptonote_basic.h:63
std::vector< uint8_t > script
Definition cryptonote_basic.h:64
Definition cryptonote_basic.h:73
crypto::hash hash
Definition cryptonote_basic.h:74
Definition cryptonote_basic.h:87
txout_to_tagged_key(const crypto::public_key &_key, const crypto::view_tag &_view_tag)
Definition cryptonote_basic.h:89
txout_to_tagged_key()
Definition cryptonote_basic.h:88
crypto::public_key key
Definition cryptonote_basic.h:90
crypto::view_tag view_tag
Definition cryptonote_basic.h:91
Definition debug_archive.h:37
a archive using the JSON standard
Definition json_archive.h:116
Definition rctTypes.h:613
std::size_t operator()(const cryptonote::account_public_address &addr) const
Definition cryptonote_basic.h:558
for dealing with variants