| 70 | } |
| 71 | |
| 72 | void 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 | |
| 99 | string AccountFromValue(const UniValue& value) |
| 100 | { |
no test coverage detected