Electroneum
Loading...
Searching...
No Matches
transaction_info.cpp
Go to the documentation of this file.
1// Copyrights(c) 2017-2021, The Electroneum Project
2// Copyrights(c) 2014-2019, The Monero Project
3//
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without modification, are
7// permitted provided that the following conditions are met:
8//
9// 1. Redistributions of source code must retain the above copyright notice, this list of
10// conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright notice, this list
13// of conditions and the following disclaimer in the documentation and/or other
14// materials provided with the distribution.
15//
16// 3. Neither the name of the copyright holder nor the names of its contributors may be
17// used to endorse or promote products derived from this software without specific
18// prior written permission.
19//
20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
28// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29//
30// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
31
32#include "transaction_info.h"
33
34
35using namespace std;
36
37namespace Electroneum {
38
40
41TransactionInfo::Transfer::Transfer(uint64_t _amount, const string &_address)
42 : amount(_amount), address(_address) {}
43
44
46 : m_direction(Direction_Out)
47 , m_pending(false)
48 , m_failed(false)
49 , m_amount(0)
50 , m_fee(0)
51 , m_blockheight(0)
52 , m_subaddrAccount(0)
53 , m_timestamp(0)
54 , m_confirmations(0)
55 , m_unlock_time(0)
56{
57
58}
59
64
66{
67 return m_direction;
68}
69
70
72{
73 return m_pending;
74}
75
77{
78 return m_failed;
79}
80
82{
83 return m_amount;
84}
85
87{
88 return m_fee;
89}
90
92{
93 return m_blockheight;
94}
95
96std::set<uint32_t> TransactionInfoImpl::subaddrIndex() const
97{
98 return m_subaddrIndex;
99}
100
102{
103 return m_subaddrAccount;
104}
105
107{
108 return m_label;
109}
110
111
113{
114 return m_hash;
115}
116
118{
119 return m_timestamp;
120}
121
123{
124 return m_paymentid;
125}
126
127const std::vector<TransactionInfo::Transfer> &TransactionInfoImpl::transfers() const
128{
129 return m_transfers;
130}
131
133{
134 return m_confirmations;
135}
136
138{
139 return m_unlock_time;
140}
141
142} // namespace
143
144namespace Bitelectroneum = Electroneum;
virtual bool isPending() const override
true if hold
virtual const std::vector< Transfer > & transfers() const override
only applicable for output transactions
virtual std::string hash() const override
transaction_id
virtual uint64_t unlockTime() const override
virtual std::string paymentId() const override
virtual uint64_t blockHeight() const override
virtual bool isFailed() const override
virtual uint64_t confirmations() const override
virtual int direction() const override
in/out
virtual uint64_t fee() const override
always 0 for incoming txes
virtual std::time_t timestamp() const override
virtual uint64_t amount() const override
virtual std::set< uint32_t > subaddrIndex() const override
virtual std::string label() const override
virtual uint32_t subaddrAccount() const override
STL namespace.
#define false
unsigned int uint32_t
Definition stdint.h:126
unsigned __int64 uint64_t
Definition stdint.h:136
Transfer(uint64_t _amount, const std::string &address)