|
|
@ -29,6 +29,7 @@ |
|
|
|
#include <univalue.h> |
|
|
|
|
|
|
|
using namespace std; |
|
|
|
int32_t komodo_dpowconfs(int32_t height,int32_t numconfs); |
|
|
|
|
|
|
|
void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex) |
|
|
|
{ |
|
|
@ -183,7 +184,8 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue& |
|
|
|
|
|
|
|
if (nConfirmations > 0) { |
|
|
|
entry.push_back(Pair("height", nHeight)); |
|
|
|
entry.push_back(Pair("confirmations", nConfirmations)); |
|
|
|
entry.push_back(Pair("confirmations", komodo_dpowconfs(nHeight,nConfirmations))); |
|
|
|
entry.push_back(Pair("rawconfirmations", nConfirmations)); |
|
|
|
entry.push_back(Pair("time", nBlockTime)); |
|
|
|
entry.push_back(Pair("blocktime", nBlockTime)); |
|
|
|
} else { |
|
|
@ -242,7 +244,8 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) |
|
|
|
CBlockIndex* pindex = (*mi).second; |
|
|
|
if (chainActive.Contains(pindex)) { |
|
|
|
entry.push_back(Pair("height", pindex->nHeight)); |
|
|
|
entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight)); |
|
|
|
entry.push_back(Pair("rawconfirmations", 1 + chainActive.Height() - pindex->nHeight)); |
|
|
|
entry.push_back(Pair("confirmations", komodo_dpowconfs(pindex->nHeight,1 + chainActive.Height() - pindex->nHeight))); |
|
|
|
entry.push_back(Pair("time", pindex->GetBlockTime())); |
|
|
|
entry.push_back(Pair("blocktime", pindex->GetBlockTime())); |
|
|
|
} else { |
|
|
@ -1032,4 +1035,4 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp) |
|
|
|
RelayTransaction(tx); |
|
|
|
|
|
|
|
return hashTx.GetHex(); |
|
|
|
} |
|
|
|
} |
|
|
|