Bitcoin
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
TransactionRecord Class Reference

#include <transactionrecord.h>

Public Types

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

Public Member Functions

 TransactionRecord ()
 
 TransactionRecord (uint256 _hash, qint64 _time)
 
 TransactionRecord (uint256 _hash, qint64 _time, Type _type, const std::string &_address, const CAmount &_debit, const CAmount &_credit)
 
QString getTxHash () const
 
int getOutputIndex () const
 
void updateStatus (const interfaces::WalletTxStatus &wtx, int numBlocks, int64_t block_time)
 
bool statusUpdateNeeded (int numBlocks) const
 

Static Public Member Functions

static bool showTransaction ()
 
static QList< TransactionRecorddecomposeTransaction (const interfaces::WalletTx &wtx)
 

Public Attributes

int idx
 
TransactionStatus status
 
bool involvesWatchAddress
 
Immutable transaction attributes
uint256 hash
 
qint64 time
 
Type type
 
std::string address
 
CAmount debit
 
CAmount credit
 

Static Public Attributes

static const int RecommendedNumConfirmations = 6
 

Detailed Description

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

Member Enumeration Documentation

◆ Type

Enumerator
Other 
Generated 
SendToAddress 
SendToOther 
RecvWithAddress 
RecvFromOther 
SendToSelf 

Constructor & Destructor Documentation

◆ TransactionRecord() [1/3]

TransactionRecord::TransactionRecord ( )
inline

◆ TransactionRecord() [2/3]

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

◆ TransactionRecord() [3/3]

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

Member Function Documentation

◆ decomposeTransaction()

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

◆ getOutputIndex()

int TransactionRecord::getOutputIndex ( ) const

Return the output index of the subtransaction

◆ getTxHash()

QString TransactionRecord::getTxHash ( ) const

Return the unique identifier for this transaction (part)

◆ showTransaction()

bool TransactionRecord::showTransaction ( )
static

Decompose CWallet transaction to model transaction records.

◆ statusUpdateNeeded()

bool TransactionRecord::statusUpdateNeeded ( int  numBlocks) const

Return whether a status update is needed.

◆ updateStatus()

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

Update status from core wallet tx.

Member Data Documentation

◆ address

std::string TransactionRecord::address

◆ credit

CAmount TransactionRecord::credit

◆ debit

CAmount TransactionRecord::debit

◆ hash

uint256 TransactionRecord::hash

◆ idx

int TransactionRecord::idx

Subtransaction index, for sort key

◆ involvesWatchAddress

bool TransactionRecord::involvesWatchAddress

Whether the transaction was sent/received with a watch-only address

◆ RecommendedNumConfirmations

const int TransactionRecord::RecommendedNumConfirmations = 6
static

Number of confirmation recommended for accepting a transaction

◆ status

TransactionStatus TransactionRecord::status

Status: can change with block chain update

◆ time

qint64 TransactionRecord::time

◆ type

Type TransactionRecord::type

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