@@ -208,22 +208,17 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
208
208
const CTxOut& prev_txout = prev_coin.out ;
209
209
210
210
amt_total_in += prev_txout.nValue ;
211
- switch (verbosity) {
212
- case TxVerbosity::SHOW_TXID:
213
- case TxVerbosity::SHOW_DETAILS:
214
- break ;
215
211
216
- case TxVerbosity::SHOW_DETAILS_AND_PREVOUT:
217
- UniValue o_script_pub_key (UniValue::VOBJ);
218
- ScriptPubKeyToUniv (prev_txout.scriptPubKey , o_script_pub_key, /* includeHex */ true );
212
+ if (verbosity == TxVerbosity::SHOW_DETAILS_AND_PREVOUT) {
213
+ UniValue o_script_pub_key (UniValue::VOBJ);
214
+ ScriptPubKeyToUniv (prev_txout.scriptPubKey , o_script_pub_key, /* include_hex= */ true );
219
215
220
- UniValue p (UniValue::VOBJ);
221
- p.pushKV (" generated" , bool (prev_coin.fCoinBase ));
222
- p.pushKV (" height" , uint64_t (prev_coin.nHeight ));
223
- p.pushKV (" value" , ValueFromAmount (prev_txout.nValue ));
224
- p.pushKV (" scriptPubKey" , o_script_pub_key);
225
- in.pushKV (" prevout" , p);
226
- break ;
216
+ UniValue p (UniValue::VOBJ);
217
+ p.pushKV (" generated" , bool (prev_coin.fCoinBase ));
218
+ p.pushKV (" height" , uint64_t (prev_coin.nHeight ));
219
+ p.pushKV (" value" , ValueFromAmount (prev_txout.nValue ));
220
+ p.pushKV (" scriptPubKey" , o_script_pub_key);
221
+ in.pushKV (" prevout" , p);
227
222
}
228
223
}
229
224
in.pushKV (" sequence" , (int64_t )txin.nSequence );
0 commit comments