34#include <boost/variant.hpp>
35#include <boost/functional/hash/hash.hpp>
97 return !(*
this == rhs);
105 std::vector<crypto::public_key>
keys;
137 std::stringstream ss;
140 std::string address_blob = ss.str();
148 if (!ar.stream().good())
241 template<typename
T> static
inline unsigned int getpos(
T &ar) {
return 0; }
301 mutable std::atomic<bool> hash_valid;
302 mutable std::atomic<bool> blob_size_valid;
322 void invalidate_hashes();
323 bool is_hash_valid()
const {
return hash_valid.load(std::memory_order_acquire); }
324 void set_hash_valid(
bool v)
const { hash_valid.store(v,std::memory_order_release); }
331 if (!typename Archive<W>::is_saving())
347 ar.tag(
"signatures");
356 size_t signature_size = get_signature_size(
vin[i]);
359 if (0 == signature_size)
371 if (
vin.size() - i > 1)
376 if (!
typename Archive<W>::is_saving())
380 template<
bool W, template <
bool> class Archive>
381 bool serialize_base(Archive<W> &ar)
385 if (!typename Archive<W>::is_saving())
387 return ar.stream().good();
391 static
size_t get_signature_size(const
txin_v& tx_in);
427 size_t transaction::get_signature_size(
const txin_v& tx_in)
429 struct txin_signature_size_visitor :
public boost::static_visitor<size_t>
431 size_t operator()(
const txin_gen& txin)
const{
return 0;}
432 size_t operator()(
const txin_to_script& txin)
const{
return 0;}
433 size_t operator()(
const txin_to_scripthash& txin)
const{
return 0;}
434 size_t operator()(
const txin_to_key& txin)
const {
return txin.key_offsets.size();}
435 size_t operator()(
const txin_to_key_public& txin)
const {
return 1;}
438 return boost::apply_visitor(txin_signature_size_visitor(), tx_in);
467 mutable std::atomic<bool> hash_valid;
474 bool is_hash_valid()
const {
return hash_valid.load(std::memory_order_acquire); }
475 void set_hash_valid(
bool v)
const { hash_valid.store(v,std::memory_order_release); }
487 if (!typename Archive<W>::is_saving())
void set_null_besides_version()
std::vector< uint8_t > extra
if(version==0||CURRENT_TRANSACTION_VERSION< version) return false
std::vector< txin_v > vin
std::vector< tx_out > vout
bool is_hash_valid() const
rct::rctSig rct_signatures
void set_hash(const crypto::hash &h)
std::atomic< unsigned int > unprunable_size
std::atomic< unsigned int > prefix_size
void set_blob_size(size_t sz)
void set_hash_valid(bool v) const
bool signatures_not_expected
if(!typename Archive< W >::is_saving())
transaction(const transaction &t)
PREPARE_CUSTOM_VECTOR_SERIALIZATION(vin.size(), signatures)
transaction & operator=(const transaction &t)
std::vector< std::vector< crypto::signature > > signatures
void set_blob_size_valid(bool v) const
const unsigned int start_pos
bool is_blob_size_valid() const
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
#define CRYPTONOTE_MAX_TX_PER_BLOCK
#define CURRENT_TRANSACTION_VERSION
#define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE(varialble)
#define END_KV_SERIALIZE_MAP()
#define BEGIN_KV_SERIALIZE_MAP()
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Holds cryptonote related classes and helpers.
boost::variant< txin_gen, txin_to_script, txin_to_scripthash, txin_to_key, txin_to_key_public > txin_v
std::vector< crypto::signature > ring_signature
boost::variant< txout_to_script, txout_to_scripthash, txout_to_key, txout_to_key_public > txout_target_v
bool serialize(Archive &ar, T &v)
#define BEGIN_SERIALIZE()
#define BEGIN_SERIALIZE_OBJECT()
#define BLOB_SERIALIZER(T)
#define PREPARE_CUSTOM_VECTOR_SERIALIZATION(size, vec)
#define VARIANT_TAG(Archive, Type, Tag)
unsigned __int64 uint64_t
crypto::public_key m_view_public_key
bool operator!=(const account_public_address &rhs) const
crypto::public_key m_spend_public_key
uint64_t relative_out_index
std::vector< uint8_t > signature
block & operator=(const block &b)
bool is_hash_valid() const
void set_hash_valid(bool v) const
std::vector< uint8_t > signatory
std::vector< crypto::hash > tx_hashes
if(!typename Archive< W >::is_saving()) set_hash_valid(false)
static keypair generate(hw::device &hwdev)
crypto::key_image k_image
std::vector< uint64_t > key_offsets
std::vector< uint8_t > sigset
std::vector< uint8_t > sigset
uint64_t m_address_prefix
cryptonote::account_public_address address
if(std::is_same< Archive< W >, json_archive< W > >())
txout_to_key(const crypto::public_key &_key)
std::vector< crypto::public_key > keys
std::vector< uint8_t > script
std::vector< uint8_t > validators
a archive using the JSON standard
std::size_t operator()(const cryptonote::account_public_address &addr) const
for dealing with variants