11 #include "validation.h" 33 QList<TransactionRecord> parts;
37 CAmount nNet = nCredit - nDebit;
39 std::map<std::string, std::string> mapValue = wtx.
mapValue;
46 for(
unsigned int i = 0; i < wtx.
tx->vout.size(); i++)
48 const CTxOut& txout = wtx.
tx->vout[i];
89 for (
const CTxIn& txin : wtx.
tx->vin)
93 if(fAllFromMe > mine) fAllFromMe = mine;
97 for (
const CTxOut& txout : wtx.
tx->vout)
106 if(fAllToMe > mine) fAllToMe = mine;
109 if (fAllFromMe && fAllToMe)
115 -(nDebit - nChange), nCredit - nChange));
123 CAmount nTxFee = nDebit - wtx.
tx->GetValueOut();
125 for (
unsigned int nOut = 0; nOut < wtx.
tx->vout.size(); nOut++)
127 const CTxOut& txout = wtx.
tx->vout[nOut];
182 bool fIsMixedDebit =
true;
184 for (
unsigned int nOut = 0; nOut < wtx.
tx->vout.size(); nOut++) {
185 const CTxOut &txout = wtx.
tx->vout[nOut];
188 fIsMixedDebit =
false;
206 std::string strSentAccount;
207 std::list<COutputEntry> listReceived;
208 std::list<COutputEntry> listSent;
210 std::list<CAssetOutputEntry> listAssetsReceived;
211 std::list<CAssetOutputEntry> listAssetsSent;
213 wtx.
GetAmounts(listReceived, listSent, nFee, strSentAccount,
ISMINE_ALL, listAssetsReceived, listAssetsSent);
215 if (listAssetsReceived.size() > 0)
227 sub.
credit = data.nAmount;
247 std::string strAddress;
262 if (listAssetsSent.size() > 0)
270 sub.
credit = -data.nAmount;
283 std::string strAddress;
312 pindex = (*mi).second;
316 (pindex ? pindex->
nHeight : std::numeric_limits<int>::max()),
326 if (wtx.
tx->nLockTime < LOCKTIME_THRESHOLD)
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Confirmed, but waiting for the recommended number of confirmations.
bool CheckIssueDataTx(const CTxOut &txOut)
issue asset scripts to make sure script meets the standards
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
Transaction not yet final, waiting for block.
int idx
Subtransaction index, for sort key.
Not sent to any other nodes.
Generated (mined) transactions.
const uint256 & GetHash() const
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
Have 6 or more confirmations (normal tx) or fully mature (mined tx)
std::string sortKey
Sorting key based on status.
int Height() const
Return the maximal height in the chain.
CCriticalSection cs_main
Global state.
bool AssetFromTransaction(const CTransaction &tx, CNewAsset &asset, std::string &strAddress)
These types of asset tx, have specific metadata at certain indexes in the transaction.
Not yet mined into a block.
isminetype IsMine(const CKeyStore &keystore, const CScript &scriptPubKey, SigVersion sigversion)
static bool showTransaction(const CWalletTx &wtx)
Decompose CWallet transaction to model transaction records.
mapValue_t mapValue
Key/value map with information about the transaction.
int64_t CAmount
Amount in corbies (Can be negative)
#define AssertLockHeld(cs)
int getOutputIndex() const
Return the output index of the subtransaction.
UI model for a transaction.
bool CheckFinalTx(const CTransaction &tx, int flags)
Transaction validation functions.
TransactionStatus status
Status: can change with block chain update.
bool AreAssetsDeployed()
RVN START.
static QList< TransactionRecord > decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
bool GetAssetMetaDataIfExists(const std::string &name, CNewAsset &asset)
Returns true if an asset with the name exists, and it was able to get the asset metadata from databas...
isminetype
IsMine() return codes.
An input of a transaction.
QString getTxID() const
Return the unique identifier for this transaction (part)
int GetBlocksToMaturity() const
bool countsForBalance
Transaction counts towards available balance.
void updateStatus(const CWalletTx &wtx)
Update status from core wallet tx.
bool statusUpdateNeeded() const
Return whether a status update is needed.
An output of a transaction.
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
std::string ToString() const
int cur_num_blocks
Current number of blocks (to know whether cached status is still valid)
Normal (sent/received) transactions.
A transaction with a bunch of additional info that only the owner cares about.
bool IsInMainChain() const
CAssetsCache * passets
Global variable that point to the active assets (protected by cs_main)
std::string EncodeDestination(const CTxDestination &dest)
CAmount GetCredit(const isminefilter &filter) const
int64_t GetTxTime() const
Conflicts with other transaction or mempool.
The block chain is a tree shaped structure starting with the genesis block at the root...
bool IsNullAssetTxDataScript() const
int64_t GetAdjustedTime()
bool involvesWatchAddress
Whether the transaction was sent/received with a watch-only address.
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
unsigned int nTimeReceived
time received by this node
int nHeight
height of the entry in the chain. The genesis block has height 0
qint64 open_for
Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined befor...
isminetype IsMine(const CTxIn &txin) const
Abandoned from the wallet.
int GetDepthInMainChain(const CBlockIndex *&pindexRet) const
Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockch...
bool IsNullGlobalRestrictionAssetTxDataScript() const
static const int RecommendedNumConfirmations
Number of confirmation recommended for accepting a transaction.
Transaction will likely not mature because no nodes have confirmed.
CAmount GetChange() const
int GetRequestCount() const
bool IsAssetNameAnOwner(const std::string &name)
Check if an asset is an owner.
bool IsAssetScript(int &nType, bool &fIsOwner, int &nStartingIndex) const
void GetAmounts(std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, std::string &strSentAccount, const isminefilter &filter) const