Browse Source

rawconfirmations

pull/4/head
jl777 6 years ago
parent
commit
a079cdbc6c
  1. 2
      src/komodo_bitcoind.h
  2. 4
      src/rpcrawtransaction.cpp
  3. 2
      src/wallet/rpcwallet.cpp

2
src/komodo_bitcoind.h

@ -391,7 +391,7 @@ int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *kmdnotarized_heig
{
if ( (item= jobj(json,(char *)"result")) != 0 )
{
txid_confirmations = jint(item,(char *)"origconfirmations");
txid_confirmations = jint(item,(char *)"rawconfirmations");
if ( txid_confirmations > 0 && height > txid_confirmations )
txid_height = height - txid_confirmations;
else txid_height = height;

4
src/rpcrawtransaction.cpp

@ -232,7 +232,7 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue&
if (nConfirmations > 0) {
entry.push_back(Pair("height", nHeight));
entry.push_back(Pair("confirmations", komodo_dpowconfs(nHeight,nConfirmations)));
entry.push_back(Pair("origconfirmations", nConfirmations));
entry.push_back(Pair("rawconfirmations", nConfirmations));
entry.push_back(Pair("time", nBlockTime));
entry.push_back(Pair("blocktime", nBlockTime));
} else {
@ -292,7 +292,7 @@ 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("origconfirmations", 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()));

2
src/wallet/rpcwallet.cpp

@ -2735,7 +2735,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
}
else if ( chainActive.LastTip() != 0 )
txheight = (chainActive.LastTip()->nHeight - out.nDepth - 1);
entry.push_back(Pair("origconfirmations",out.nDepth));
entry.push_back(Pair("rawconfirmations",out.nDepth));
entry.push_back(Pair("confirmations",komodo_dpowconfs(txheight,out.nDepth)));
entry.push_back(Pair("spendable", out.fSpendable));
results.push_back(entry);

Loading…
Cancel
Save