Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Update transaction records with better bet payout info #10

Open
wants to merge 1 commit into
base: tmp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ QString TransactionTableModel::formatTxType(const TransactionRecord* wtx) const
return tr("Minted Change as zWGR from zWGR Spend");
case TransactionRecord::ZerocoinSpend_FromMe:
return tr("Converted zWGR to WGR");
case TransactionRecord::BetWin:
return tr("Bet Payout");

default:
return QString();
Expand Down Expand Up @@ -425,6 +427,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord* wtx, b
case TransactionRecord::ZerocoinSpend:
case TransactionRecord::ZerocoinSpend_FromMe:
case TransactionRecord::RecvFromZerocoinSpend:
case TransactionRecord::BetWin:
return lookupAddress(wtx->address, tooltip);
case TransactionRecord::Obfuscated:
return lookupAddress(wtx->address, tooltip) + watchAddress;
Expand All @@ -448,7 +451,8 @@ QVariant TransactionTableModel::addressColor(const TransactionRecord* wtx) const
case TransactionRecord::RecvWithAddress:
case TransactionRecord::SendToAddress:
case TransactionRecord::Generated:
case TransactionRecord::MNReward: {
case TransactionRecord::MNReward:
case TransactionRecord::BetWin: {
QString label = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(wtx->address));
if (label.isEmpty())
return COLOR_BAREADDRESS;
Expand Down Expand Up @@ -524,7 +528,8 @@ QString TransactionTableModel::formatTooltip(const TransactionRecord* rec) const
{
QString tooltip = formatTxStatus(rec) + QString("\n") + formatTxType(rec);
if (rec->type == TransactionRecord::RecvFromOther || rec->type == TransactionRecord::SendToOther ||
rec->type == TransactionRecord::SendToAddress || rec->type == TransactionRecord::RecvWithAddress || rec->type == TransactionRecord::MNReward) {
rec->type == TransactionRecord::SendToAddress || rec->type == TransactionRecord::RecvWithAddress ||
rec->type == TransactionRecord::MNReward || rec->type == TransactionRecord::BetWin) {
tooltip += QString(" ") + formatTxToAddress(rec, true);
}
return tooltip;
Expand Down
3 changes: 2 additions & 1 deletion src/transactionrecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ bool DecomposeBettingCoinstake(const CWallet* wallet, const CWalletTx& wtx, cons
nStakeValueFound += curOut.nValue;
stakeRewards.insert(std::make_pair(i, curOut));
} else {
betRewards.insert(std::make_pair(i, curOut));
allStakesFound = true;
}
} else {
Expand Down Expand Up @@ -543,7 +544,7 @@ std::string TransactionRecord::GetTransactionRecordType(Type type) const
switch (type)
{
case Other: return "Other";
case BetWin: return "BetWinnings";
case BetWin: return "BetPayout";
case BetPlaced: return "Bet";
case Generated: return "Generated";
case StakeMint: return "StakeMint";
Expand Down