Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
TransactionRecord Class Reference

UI model for a transaction. More...

#include <transactionrecord.h>

Collaboration diagram for TransactionRecord:
[legend]

Public Types

enum  Type {
  Other , Generated , SendToAddress , SendToOther ,
  RecvWithAddress , RecvFromOther
}

Public Member Functions

 TransactionRecord ()
 TransactionRecord (Txid _hash, qint64 _time)
 TransactionRecord (Txid _hash, qint64 _time, Type _type, const std::string &_address, const CAmount &_debit, const CAmount &_credit)
QString getTxHash () const
 Return the unique identifier for this transaction (part).
int getOutputIndex () const
 Return the output index of the subtransaction.
void updateStatus (const interfaces::WalletTxStatus &wtx, const uint256 &block_hash, int numBlocks, int64_t block_time)
 Update status from core wallet tx.
bool statusUpdateNeeded (const uint256 &block_hash) const
 Return whether a status update is needed.

Static Public Member Functions

static bool showTransaction ()
 Decompose CWallet transaction to model transaction records.
static QList< TransactionRecorddecomposeTransaction (const interfaces::WalletTx &wtx)

Public Attributes

int idx
 Subtransaction index, for sort key.
TransactionStatus status
 Status: can change with block chain update.
Immutable transaction attributes
Txid hash
qint64 time
Type type
std::string address
CAmount debit
CAmount credit

Static Public Attributes

static const int RecommendedNumConfirmations = 6
 Number of confirmation recommended for accepting a transaction.

Detailed Description

UI model for a transaction.

A core transaction can be represented by multiple UI transactions if it has multiple outputs.

Definition at line 62 of file transactionrecord.h.

Member Enumeration Documentation

◆ Type

Enumerator
Other 
Generated 
SendToAddress 
SendToOther 
RecvWithAddress 
RecvFromOther 

Definition at line 65 of file transactionrecord.h.

Constructor & Destructor Documentation

◆ TransactionRecord() [1/3]

TransactionRecord::TransactionRecord ( )
inline

Definition at line 78 of file transactionrecord.h.

Here is the caller graph for this function:

◆ TransactionRecord() [2/3]

TransactionRecord::TransactionRecord ( Txid _hash,
qint64 _time )
inline

Definition at line 83 of file transactionrecord.h.

◆ TransactionRecord() [3/3]

TransactionRecord::TransactionRecord ( Txid _hash,
qint64 _time,
Type _type,
const std::string & _address,
const CAmount & _debit,
const CAmount & _credit )
inline

Definition at line 89 of file transactionrecord.h.

Member Function Documentation

◆ decomposeTransaction()

QList< TransactionRecord > TransactionRecord::decomposeTransaction ( const interfaces::WalletTx & wtx)
static

Definition at line 27 of file transactionrecord.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOutputIndex()

int TransactionRecord::getOutputIndex ( ) const

Return the output index of the subtransaction.

Definition at line 215 of file transactionrecord.cpp.

Here is the caller graph for this function:

◆ getTxHash()

QString TransactionRecord::getTxHash ( ) const

Return the unique identifier for this transaction (part).

Definition at line 210 of file transactionrecord.cpp.

Here is the caller graph for this function:

◆ showTransaction()

bool TransactionRecord::showTransaction ( )
static

Decompose CWallet transaction to model transaction records.

Definition at line 17 of file transactionrecord.cpp.

Here is the caller graph for this function:

◆ statusUpdateNeeded()

bool TransactionRecord::statusUpdateNeeded ( const uint256 & block_hash) const

Return whether a status update is needed.

Definition at line 204 of file transactionrecord.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateStatus()

void TransactionRecord::updateStatus ( const interfaces::WalletTxStatus & wtx,
const uint256 & block_hash,
int numBlocks,
int64_t block_time )

Update status from core wallet tx.

Definition at line 136 of file transactionrecord.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ address

std::string TransactionRecord::address

Definition at line 107 of file transactionrecord.h.

◆ credit

CAmount TransactionRecord::credit

Definition at line 109 of file transactionrecord.h.

◆ debit

CAmount TransactionRecord::debit

Definition at line 108 of file transactionrecord.h.

◆ hash

Txid TransactionRecord::hash

Definition at line 104 of file transactionrecord.h.

◆ idx

int TransactionRecord::idx

Subtransaction index, for sort key.

Definition at line 113 of file transactionrecord.h.

◆ RecommendedNumConfirmations

const int TransactionRecord::RecommendedNumConfirmations = 6
static

Number of confirmation recommended for accepting a transaction.

Definition at line 76 of file transactionrecord.h.

◆ status

TransactionStatus TransactionRecord::status

Status: can change with block chain update.

Definition at line 116 of file transactionrecord.h.

◆ time

qint64 TransactionRecord::time

Definition at line 105 of file transactionrecord.h.

◆ type

Type TransactionRecord::type

Definition at line 106 of file transactionrecord.h.


The documentation for this class was generated from the following files: