97{
98
99
100
101 boost::unique_lock<boost::shared_mutex> lock(m_historyMutex);
102
103
106 uint64_t wallet_height = m_wallet->blockChainHeight();
107
108
109 for (auto t : m_history)
110 delete t;
111 m_history.clear();
112
113
114
115
116
117
118
119
120
121 std::list<std::pair<crypto::hash, tools::wallet2::payment_details>> in_payments;
122 m_wallet->m_wallet->get_payments(in_payments, min_height, max_height);
123 for (std::list<std::pair<crypto::hash, tools::wallet2::payment_details>>::const_iterator i = in_payments.begin(); i != in_payments.end(); ++i) {
124 const tools::wallet2::payment_details &pd = i->second;
126 if (payment_id.substr(16).find_first_not_of('0') == std::string::npos)
127 payment_id = payment_id.substr(0,16);
128 TransactionInfoImpl * ti = new TransactionInfoImpl();
129 ti->m_paymentid = payment_id;
136 ti->m_label = m_wallet->m_wallet->get_subaddress_label(pd.
m_subaddr_index);
140 m_history.push_back(ti);
141
142 }
143
144
145
146
147
148
149
150
151
152 std::list<std::pair<crypto::hash, tools::wallet2::confirmed_transfer_details>> out_payments;
153 m_wallet->m_wallet->get_payments_out(out_payments, min_height, max_height);
154
155 for (std::list<std::pair<crypto::hash, tools::wallet2::confirmed_transfer_details>>::const_iterator i = out_payments.begin();
156 i != out_payments.end(); ++i) {
157
159 const tools::wallet2::confirmed_transfer_details &pd = i->second;
160
163
164
166 if (payment_id.substr(16).find_first_not_of('0') == std::string::npos)
167 payment_id = payment_id.substr(0,16);
168
169
170 TransactionInfoImpl * ti = new TransactionInfoImpl();
171 ti->m_paymentid = payment_id;
173 ti->m_fee = fee;
182
183
184 for (
const auto &d: pd.
m_dests) {
186 }
187 m_history.push_back(ti);
188 }
189
190
191 std::list<std::pair<crypto::hash, tools::wallet2::unconfirmed_transfer_details>> upayments_out;
192 m_wallet->m_wallet->get_unconfirmed_payments_out(upayments_out);
193 for (std::list<std::pair<crypto::hash, tools::wallet2::unconfirmed_transfer_details>>::const_iterator i = upayments_out.begin(); i != upayments_out.end(); ++i) {
194 const tools::wallet2::unconfirmed_transfer_details &pd = i->second;
199 if (payment_id.substr(16).find_first_not_of('0') == std::string::npos)
200 payment_id = payment_id.substr(0,16);
202
203 TransactionInfoImpl * ti = new TransactionInfoImpl();
204 ti->m_paymentid = payment_id;
205 ti->m_amount = amount - pd.
m_change - fee;
206 ti->m_fee = fee;
208 ti->m_failed = is_failed;
209 ti->m_pending = true;
215 ti->m_confirmations = 0;
216 m_history.push_back(ti);
217 }
218
219
220
221 std::list<std::pair<crypto::hash, tools::wallet2::pool_payment_details>> upayments;
222 m_wallet->m_wallet->get_unconfirmed_payments(upayments);
223 for (std::list<std::pair<crypto::hash, tools::wallet2::pool_payment_details>>::const_iterator i = upayments.begin(); i != upayments.end(); ++i) {
224 const tools::wallet2::payment_details &pd = i->second.m_pd;
226 if (payment_id.substr(16).find_first_not_of('0') == std::string::npos)
227 payment_id = payment_id.substr(0,16);
228 TransactionInfoImpl * ti = new TransactionInfoImpl();
229 ti->m_paymentid = payment_id;
234 ti->m_pending = true;
237 ti->m_label = m_wallet->m_wallet->get_subaddress_label(pd.
m_subaddr_index);
239 ti->m_confirmations = 0;
240 m_history.push_back(ti);
241
243 }
244
245}
std::string get_account_address_as_str(network_type nettype, bool subaddress, account_public_address const &adr)
unsigned __int64 uint64_t