Electroneum
cryptonote::tx_extra_padding Struct Reference

#include <tx_extra.h>

Collaboration diagram for cryptonote::tx_extra_padding:

Public Member Functions

template<template< bool > class Archive>
bool do_serialize (Archive< false > &ar)
 
template<template< bool > class Archive>
bool do_serialize (Archive< true > &ar)
 

Public Attributes

size_t size
 

Detailed Description

Definition at line 50 of file tx_extra.h.

Member Function Documentation

◆ do_serialize() [1/2]

template<template< bool > class Archive>
bool cryptonote::tx_extra_padding::do_serialize ( Archive< false > &  ar)
inline

Definition at line 56 of file tx_extra.h.

57  {
58  // size - 1 - because of variant tag
59  for (size = 1; size <= TX_EXTRA_PADDING_MAX_COUNT; ++size)
60  {
61  std::ios_base::iostate state = ar.stream().rdstate();
62  bool eof = EOF == ar.stream().peek();
63  ar.stream().clear(state);
64 
65  if (eof)
66  break;
67 
68  uint8_t zero;
69  if (!::do_serialize(ar, zero))
70  return false;
71 
72  if (0 != zero)
73  return false;
74  }
75 
77  }
key zero()
Definition: rctOps.h:70
unsigned char uint8_t
Definition: stdint.h:124
bool do_serialize(Archive< false > &ar)
Definition: tx_extra.h:56
Definition: blake256.h:37
#define TX_EXTRA_PADDING_MAX_COUNT
Definition: tx_extra.h:35
Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_serialize() [2/2]

template<template< bool > class Archive>
bool cryptonote::tx_extra_padding::do_serialize ( Archive< true > &  ar)
inline

Definition at line 81 of file tx_extra.h.

82  {
84  return false;
85 
86  // i = 1 - because of variant tag
87  for (size_t i = 1; i < size; ++i)
88  {
89  uint8_t zero = 0;
90  if (!::do_serialize(ar, zero))
91  return false;
92  }
93  return true;
94  }
Here is the call graph for this function:

Member Data Documentation

◆ size

size_t cryptonote::tx_extra_padding::size

Definition at line 52 of file tx_extra.h.


The documentation for this struct was generated from the following file: