MCPcopy Create free account
hub / github.com/LUX-Core/lux / WalletTxToJSON

Function WalletTxToJSON

src/rpcwallet.cpp:72–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
73{
74 int confirms = wtx.GetDepthInMainChain(false);
75 int confirmsTotal = GetIXConfirmations(wtx.GetHash()) + confirms;
76 entry.push_back(Pair("confirmations", confirmsTotal));
77 entry.push_back(Pair("bcconfirmations", confirms));
78 if (wtx.IsCoinGenerated())
79 entry.push_back(Pair("generated", true));
80 if (confirms > 0) {
81 entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
82 entry.push_back(Pair("blockindex", wtx.nIndex));
83 entry.push_back(Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime()));
84 } else {
85 entry.push_back(Pair("trusted", wtx.IsTrusted()));
86 }
87 uint256 hash = wtx.GetHash();
88 entry.push_back(Pair("txid", hash.GetHex()));
89 UniValue conflicts(UniValue::VARR);
90 for (const uint256& conflict : wtx.GetConflicts())
91 conflicts.push_back(conflict.GetHex());
92 entry.push_back(Pair("walletconflicts", conflicts));
93 entry.push_back(Pair("time", wtx.GetTxTime()));
94 entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived));
95 for (const PAIRTYPE(string, string) & item : wtx.mapValue)
96 entry.push_back(Pair(item.first, item.second));
97}
98
99string AccountFromValue(const UniValue& value)
100{

Callers 2

ListTransactionsFunction · 0.85
gettransactionFunction · 0.85

Calls 11

GetIXConfirmationsFunction · 0.85
PairFunction · 0.85
IsTrustedMethod · 0.80
GetConflictsMethod · 0.80
GetTxTimeMethod · 0.80
GetDepthInMainChainMethod · 0.45
GetHashMethod · 0.45
push_backMethod · 0.45
IsCoinGeneratedMethod · 0.45
GetHexMethod · 0.45
GetBlockTimeMethod · 0.45

Tested by

no test coverage detected