Skip to content

Commit b5466e2

Browse files
UdjinM6codablock
authored andcommitted
Add "chainlock" field to more rpcs (#2743)
1 parent 8dd9349 commit b5466e2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/rpc/rawtransaction.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
267267
" \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n"
268268
" \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n"
269269
" \"instantlock\" : true|false, (bool) Current transaction lock state\n"
270+
" \"chainlock\" : true|false, (bool) The state of the corresponding block chainlock\n"
270271
"}\n"
271272

272273
"\nExamples:\n"

src/wallet/rpcwallet.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "keepass.h"
2323
#include "privatesend-client.h"
2424

25+
#include "llmq/quorums_chainlocks.h"
26+
2527
#include <stdint.h>
2628

2729
#include <boost/assign/list_of.hpp>
@@ -62,8 +64,10 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
6264
{
6365
int confirms = wtx.GetDepthInMainChain();
6466
bool fLocked = instantsend.IsLockedInstantSendTransaction(wtx.GetHash());
67+
bool chainlock = llmq::chainLocksHandler->HasChainLock(wtx.nIndex, wtx.hashBlock);
6568
entry.push_back(Pair("confirmations", confirms));
6669
entry.push_back(Pair("instantlock", fLocked));
70+
entry.push_back(Pair("chainlock", chainlock));
6771
if (wtx.IsCoinBase())
6872
entry.push_back(Pair("generated", true));
6973
if (confirms > 0)
@@ -1552,6 +1556,7 @@ UniValue listtransactions(const JSONRPCRequest& request)
15521556
" \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
15531557
" 'send' category of transactions.\n"
15541558
" \"instantlock\" : true|false, (bool) Current transaction lock state. Available for 'send' and 'receive' category of transactions.\n"
1559+
" \"chainlock\" : true|false, (bool) The state of the corresponding block chainlock\n"
15551560
" \"confirmations\": n, (numeric) The number of blockchain confirmations for the transaction. Available for 'send' and \n"
15561561
" 'receive' category of transactions. Negative confirmations indicate the\n"
15571562
" transation conflicts with the block chain\n"
@@ -1756,6 +1761,7 @@ UniValue listsinceblock(const JSONRPCRequest& request)
17561761
" \"vout\" : n, (numeric) the vout value\n"
17571762
" \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the 'send' category of transactions.\n"
17581763
" \"instantlock\" : true|false, (bool) Current transaction lock state. Available for 'send' and 'receive' category of transactions.\n"
1764+
" \"chainlock\" : true|false, (bool) The state of the corresponding block chainlock\n"
17591765
" \"confirmations\" : n, (numeric) The number of blockchain confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n"
17601766
" When it's < 0, it means the transaction conflicted that many blocks ago.\n"
17611767
" \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n"
@@ -1858,6 +1864,7 @@ UniValue gettransaction(const JSONRPCRequest& request)
18581864
" \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
18591865
" 'send' category of transactions.\n"
18601866
" \"instantlock\" : true|false, (bool) Current transaction lock state\n"
1867+
" \"chainlock\" : true|false, (bool) The state of the corresponding block chainlock\n"
18611868
" \"confirmations\" : n, (numeric) The number of blockchain confirmations\n"
18621869
" \"blockhash\" : \"hash\", (string) The block hash\n"
18631870
" \"blockindex\" : xx, (numeric) The index of the transaction in the block that includes it\n"

0 commit comments

Comments
 (0)