2020-12-17 23:12:39 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
|
|
|
|
* Copyright (C) 2020 Tom Zander <tom@flowee.org>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
#include "TransactionInfo.h"
|
|
|
|
|
|
|
|
|
|
TransactionInfo::TransactionInfo(QObject *parent)
|
|
|
|
|
: QObject(parent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int TransactionInfo::txSize() const
|
|
|
|
|
{
|
|
|
|
|
return m_txSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<QObject *> TransactionInfo::outputs() const
|
|
|
|
|
{
|
|
|
|
|
QList<QObject *> answer;
|
|
|
|
|
for (auto o : m_outputs) {
|
|
|
|
|
answer.append(o);
|
|
|
|
|
}
|
|
|
|
|
return answer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<QObject *> TransactionInfo::inputs() const
|
|
|
|
|
{
|
|
|
|
|
QList<QObject *> answer;
|
|
|
|
|
for (auto i : m_inputs) {
|
|
|
|
|
answer.append(i);
|
|
|
|
|
}
|
|
|
|
|
return answer;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-16 15:01:02 +01:00
|
|
|
const QString &TransactionInfo::userComment() const
|
|
|
|
|
{
|
|
|
|
|
return m_userComment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TransactionInfo::isCashFusion() const
|
|
|
|
|
{
|
|
|
|
|
return m_isCashFusion;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TransactionInfo::isCoinbase() const
|
|
|
|
|
{
|
|
|
|
|
return m_isCoinbase;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-04 20:09:43 +01:00
|
|
|
bool TransactionInfo::createdByUs() const
|
|
|
|
|
{
|
|
|
|
|
return m_createdByUs;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-19 11:54:07 +01:00
|
|
|
|
|
|
|
|
// //////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
TransactionInputInfo::TransactionInputInfo(QObject *parent)
|
|
|
|
|
: QObject(parent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-17 23:12:39 +01:00
|
|
|
QString TransactionInputInfo::address() const
|
|
|
|
|
{
|
|
|
|
|
return m_address;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TransactionInputInfo::setAddress(const QString &address)
|
|
|
|
|
{
|
|
|
|
|
m_address = address;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qint64 TransactionInputInfo::value() const
|
|
|
|
|
{
|
|
|
|
|
return m_value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TransactionInputInfo::setValue(const qint64 &value)
|
|
|
|
|
{
|
|
|
|
|
m_value = value;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-19 11:54:07 +01:00
|
|
|
const QString &TransactionInputInfo::cloakedAddress() const
|
|
|
|
|
{
|
|
|
|
|
return m_cloakedAddress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TransactionInputInfo::setCloakedAddress(const QString &newCloakedAddress)
|
|
|
|
|
{
|
|
|
|
|
m_cloakedAddress = newCloakedAddress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //////////////////////////////////////////////////////
|
|
|
|
|
|
2020-12-17 23:12:39 +01:00
|
|
|
QString TransactionOutputInfo::address() const
|
|
|
|
|
{
|
|
|
|
|
return m_address;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TransactionOutputInfo::setAddress(const QString &address)
|
|
|
|
|
{
|
|
|
|
|
m_address = address;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qint64 TransactionOutputInfo::value() const
|
|
|
|
|
{
|
|
|
|
|
return m_value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TransactionOutputInfo::setValue(const qint64 &value)
|
|
|
|
|
{
|
|
|
|
|
m_value = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TransactionOutputInfo::spent() const
|
|
|
|
|
{
|
|
|
|
|
return m_spent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TransactionOutputInfo::setSpent(bool spent)
|
|
|
|
|
{
|
|
|
|
|
m_spent = spent;
|
|
|
|
|
}
|
2020-12-26 16:51:54 +01:00
|
|
|
|
|
|
|
|
bool TransactionOutputInfo::forMe() const
|
|
|
|
|
{
|
|
|
|
|
return m_forMe;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TransactionOutputInfo::setForMe(bool forMe)
|
|
|
|
|
{
|
|
|
|
|
m_forMe = forMe;
|
|
|
|
|
}
|
2021-11-19 11:54:07 +01:00
|
|
|
|
|
|
|
|
const QString &TransactionOutputInfo::cloakedAddress() const
|
|
|
|
|
{
|
|
|
|
|
return m_cloakedAddress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TransactionOutputInfo::setCloakedAddress(const QString &ad)
|
|
|
|
|
{
|
|
|
|
|
m_cloakedAddress = ad;
|
|
|
|
|
}
|