Merge pull request #392 from jl777/dev
April 5th activation of interest calc fix, along with more notarization getinfo data
This commit is contained in:
@@ -371,8 +371,8 @@ int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *kmdnotarized_heig
|
||||
{
|
||||
if ( (item= jobj(json,(char *)"result")) != 0 )
|
||||
{
|
||||
*kmdnotarized_heightp = jint(item,(char *)"notarized");
|
||||
height = jint(item,(char *)"blocks");
|
||||
*kmdnotarized_heightp = strcmp(dest,"KMD") == 0 ? jint(item,(char *)"notarized") : height;
|
||||
}
|
||||
free_json(json);
|
||||
}
|
||||
@@ -389,6 +389,7 @@ int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *kmdnotarized_heig
|
||||
txid_confirmations = jint(item,(char *)"confirmations");
|
||||
if ( txid_confirmations > 0 && height > txid_confirmations )
|
||||
txid_height = height - txid_confirmations;
|
||||
else txid_height = height;
|
||||
//printf("height.%d tconfs.%d txid_height.%d\n",height,txid_confirmations,txid_height);
|
||||
}
|
||||
free_json(json);
|
||||
|
||||
@@ -52,8 +52,7 @@ int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *kmdnotarized_heig
|
||||
|
||||
Value getinfo(const Array& params, bool fHelp)
|
||||
{
|
||||
uint256 notarized_hash,notarized_desttxid;
|
||||
int32_t notarized_height,longestchain;
|
||||
uint256 notarized_hash,notarized_desttxid; int32_t notarized_height,longestchain,kmdnotarized_height,txid_height;
|
||||
if (fHelp || params.size() != 0)
|
||||
throw runtime_error(
|
||||
"getinfo\n"
|
||||
@@ -99,14 +98,13 @@ Value getinfo(const Array& params, bool fHelp)
|
||||
obj.push_back(Pair("notarized", notarized_height));
|
||||
obj.push_back(Pair("notarizedhash", notarized_hash.ToString()));
|
||||
obj.push_back(Pair("notarizedtxid", notarized_desttxid.ToString()));
|
||||
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
||||
{
|
||||
int32_t kmdnotarized_height,txid_height;
|
||||
txid_height = notarizedtxid_height(ASSETCHAINS_SYMBOL[0] != 0 ? (char *)"KMD" : (char *)"BTC",(char *)notarized_desttxid.ToString().c_str(),&kmdnotarized_height);
|
||||
txid_height = notarizedtxid_height(ASSETCHAINS_SYMBOL[0] != 0 ? (char *)"KMD" : (char *)"BTC",(char *)notarized_desttxid.ToString().c_str(),&kmdnotarized_height);
|
||||
if ( txid_height > 0 )
|
||||
obj.push_back(Pair("notarizedtxid_height", txid_height));
|
||||
obj.push_back(Pair("kmdnotarized_height", kmdnotarized_height));
|
||||
obj.push_back(Pair("notarized_confirms", txid_height < kmdnotarized_height ? (kmdnotarized_height - txid_height) : 0));
|
||||
}
|
||||
else obj.push_back(Pair("notarizedtxid_height", "mempool"));
|
||||
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
||||
obj.push_back(Pair("KMDnotarized_height", kmdnotarized_height));
|
||||
obj.push_back(Pair("notarized_confirms", txid_height < kmdnotarized_height ? (kmdnotarized_height - txid_height + 1) : 0));
|
||||
#ifdef ENABLE_WALLET
|
||||
if (pwalletMain) {
|
||||
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
|
||||
|
||||
Reference in New Issue
Block a user