mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
rpc: add "ischange: true" in wallet gettransaction decoded tx output
This commit is contained in:
@@ -168,7 +168,7 @@ void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex, bool i
|
||||
out.pushKV("type", GetTxnOutputType(type));
|
||||
}
|
||||
|
||||
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex, const CTxUndo* txundo, TxVerbosity verbosity)
|
||||
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex, const CTxUndo* txundo, TxVerbosity verbosity, std::function<bool(const CTxOut&)> is_change_func)
|
||||
{
|
||||
CHECK_NONFATAL(verbosity >= TxVerbosity::SHOW_DETAILS);
|
||||
|
||||
@@ -243,6 +243,11 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
|
||||
UniValue o(UniValue::VOBJ);
|
||||
ScriptToUniv(txout.scriptPubKey, /*out=*/o, /*include_hex=*/true, /*include_address=*/true);
|
||||
out.pushKV("scriptPubKey", std::move(o));
|
||||
|
||||
if (is_change_func && is_change_func(txout)) {
|
||||
out.pushKV("ischange", true);
|
||||
}
|
||||
|
||||
vout.push_back(std::move(out));
|
||||
|
||||
if (have_undo) {
|
||||
|
||||
Reference in New Issue
Block a user