Skip to content

Commit

Permalink
Add blocktime to gettaddressdeltas and getaddressutxos
Browse files Browse the repository at this point in the history
  • Loading branch information
miketout committed Sep 10, 2022
1 parent 4beec95 commit 35e7b4b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,10 @@ UniValue getaddressutxos(const UniValue& params, bool fHelp)
CurrencyValuesAndNames(output, false, it->second.script, it->second.satoshis, friendlyNames);
output.push_back(Pair("satoshis", it->second.satoshis));
output.push_back(Pair("height", it->second.blockHeight));
if (chainActive.Height() >= it->second.blockHeight)
{
output.push_back(Pair("blocktime", chainActive[it->second.blockHeight]->GetBlockTime()));
}
utxos.push_back(output);
}

Expand Down Expand Up @@ -1943,6 +1947,10 @@ UniValue getaddressdeltas(const UniValue& params, bool fHelp)
delta.push_back(Pair("blockindex", (int)it->first.txindex));
delta.push_back(Pair("height", it->first.blockHeight));
delta.push_back(Pair("address", address));
if (chainActive.Height() >= it->first.blockHeight)
{
delta.push_back(Pair("blocktime", chainActive[it->first.blockHeight]->GetBlockTime()));
}

uint256 blockHash;
if (verbosity && (it->first.txhash == curTx.GetHash() || myGetTransaction(it->first.txhash, curTx, blockHash)))
Expand Down

0 comments on commit 35e7b4b

Please sign in to comment.