Skip to content

Commit 5c34507

Browse files
fyquahkiminuo
authored andcommitted
core_write: Rename calculate_fee to have_undo for clarity
1 parent 8edf620 commit 5c34507

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core_write.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
179179

180180
// If available, use Undo data to calculate the fee. Note that txundo == nullptr
181181
// for coinbase transactions and for transactions where undo data is unavailable.
182-
const bool calculate_fee = txundo != nullptr;
182+
const bool have_undo = txundo != nullptr;
183183
CAmount amt_total_in = 0;
184184
CAmount amt_total_out = 0;
185185

@@ -203,7 +203,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
203203
}
204204
in.pushKV("txinwitness", txinwitness);
205205
}
206-
if (calculate_fee) {
206+
if (have_undo) {
207207
const Coin& prev_coin = txundo->vprevout[i];
208208
const CTxOut& prev_txout = prev_coin.out;
209209

@@ -245,13 +245,13 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
245245
out.pushKV("scriptPubKey", o);
246246
vout.push_back(out);
247247

248-
if (calculate_fee) {
248+
if (have_undo) {
249249
amt_total_out += txout.nValue;
250250
}
251251
}
252252
entry.pushKV("vout", vout);
253253

254-
if (calculate_fee) {
254+
if (have_undo) {
255255
const CAmount fee = amt_total_in - amt_total_out;
256256
CHECK_NONFATAL(MoneyRange(fee));
257257
entry.pushKV("fee", ValueFromAmount(fee));

0 commit comments

Comments
 (0)