Skip to content

Commit

Permalink
rpc: Show the reward value for coinstake transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Sep 18, 2024
1 parent fea7838 commit a3317da
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,13 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry

if (have_undo) {
const CAmount fee = amt_total_in - amt_total_out;
CHECK_NONFATAL(MoneyRange(fee));
entry.pushKV("fee", ValueFromAmount(fee));
if (!tx.IsCoinStake()) {
CHECK_NONFATAL(MoneyRange(fee));
entry.pushKV("fee", ValueFromAmount(fee));
}
else {
entry.pushKV("reward", ValueFromAmount(-fee));
}
}

if (!block_hash.IsNull()) {
Expand Down

0 comments on commit a3317da

Please sign in to comment.