diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index b0e59bdf373fa..954bcdb47477e 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -26,6 +26,8 @@ #include "evo/specialtx.h" #include "evo/cbtx.h" +#include "llmq/quorums_chainlocks.h" + #include #include @@ -109,6 +111,9 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex) CBlockIndex *pnext = chainActive.Next(blockindex); if (pnext) result.push_back(Pair("nextblockhash", pnext->GetBlockHash().GetHex())); + + result.push_back(Pair("chainlock", llmq::chainLocksHandler->HasChainLock(blockindex->nHeight, blockindex->GetBlockHash()))); + return result; } @@ -159,6 +164,9 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx CBlockIndex *pnext = chainActive.Next(blockindex); if (pnext) result.push_back(Pair("nextblockhash", pnext->GetBlockHash().GetHex())); + + result.push_back(Pair("chainlock", llmq::chainLocksHandler->HasChainLock(blockindex->nHeight, blockindex->GetBlockHash()))); + return result; } diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index ec98823b067c7..2baf938489430 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -32,6 +32,8 @@ #include "evo/specialtx.h" #include "evo/providertx.h" #include "evo/cbtx.h" + +#include "llmq/quorums_chainlocks.h" #include "llmq/quorums_commitment.h" #include @@ -176,6 +178,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) } } + bool chainLock = false; if (!hashBlock.IsNull()) { entry.push_back(Pair("blockhash", hashBlock.GetHex())); BlockMap::iterator mi = mapBlockIndex.find(hashBlock); @@ -186,6 +189,8 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight)); entry.push_back(Pair("time", pindex->GetBlockTime())); entry.push_back(Pair("blocktime", pindex->GetBlockTime())); + + chainLock = llmq::chainLocksHandler->HasChainLock(pindex->nHeight, pindex->GetBlockHash()); } else { entry.push_back(Pair("height", -1)); entry.push_back(Pair("confirmations", 0)); @@ -194,6 +199,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) } bool fLocked = instantsend.IsLockedInstantSendTransaction(txid); entry.push_back(Pair("instantlock", fLocked)); + entry.push_back(Pair("chainlock", chainLock)); } UniValue getrawtransaction(const JSONRPCRequest& request)