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 )
|
if ( (item= jobj(json,(char *)"result")) != 0 )
|
||||||
{
|
{
|
||||||
*kmdnotarized_heightp = jint(item,(char *)"notarized");
|
|
||||||
height = jint(item,(char *)"blocks");
|
height = jint(item,(char *)"blocks");
|
||||||
|
*kmdnotarized_heightp = strcmp(dest,"KMD") == 0 ? jint(item,(char *)"notarized") : height;
|
||||||
}
|
}
|
||||||
free_json(json);
|
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");
|
txid_confirmations = jint(item,(char *)"confirmations");
|
||||||
if ( txid_confirmations > 0 && height > txid_confirmations )
|
if ( txid_confirmations > 0 && height > txid_confirmations )
|
||||||
txid_height = 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);
|
//printf("height.%d tconfs.%d txid_height.%d\n",height,txid_confirmations,txid_height);
|
||||||
}
|
}
|
||||||
free_json(json);
|
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)
|
Value getinfo(const Array& params, bool fHelp)
|
||||||
{
|
{
|
||||||
uint256 notarized_hash,notarized_desttxid;
|
uint256 notarized_hash,notarized_desttxid; int32_t notarized_height,longestchain,kmdnotarized_height,txid_height;
|
||||||
int32_t notarized_height,longestchain;
|
|
||||||
if (fHelp || params.size() != 0)
|
if (fHelp || params.size() != 0)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"getinfo\n"
|
"getinfo\n"
|
||||||
@@ -99,14 +98,13 @@ Value getinfo(const Array& params, bool fHelp)
|
|||||||
obj.push_back(Pair("notarized", notarized_height));
|
obj.push_back(Pair("notarized", notarized_height));
|
||||||
obj.push_back(Pair("notarizedhash", notarized_hash.ToString()));
|
obj.push_back(Pair("notarizedhash", notarized_hash.ToString()));
|
||||||
obj.push_back(Pair("notarizedtxid", notarized_desttxid.ToString()));
|
obj.push_back(Pair("notarizedtxid", notarized_desttxid.ToString()));
|
||||||
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
txid_height = notarizedtxid_height(ASSETCHAINS_SYMBOL[0] != 0 ? (char *)"KMD" : (char *)"BTC",(char *)notarized_desttxid.ToString().c_str(),&kmdnotarized_height);
|
||||||
{
|
if ( txid_height > 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);
|
|
||||||
obj.push_back(Pair("notarizedtxid_height", txid_height));
|
obj.push_back(Pair("notarizedtxid_height", txid_height));
|
||||||
obj.push_back(Pair("kmdnotarized_height", kmdnotarized_height));
|
else obj.push_back(Pair("notarizedtxid_height", "mempool"));
|
||||||
obj.push_back(Pair("notarized_confirms", txid_height < kmdnotarized_height ? (kmdnotarized_height - txid_height) : 0));
|
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
|
#ifdef ENABLE_WALLET
|
||||||
if (pwalletMain) {
|
if (pwalletMain) {
|
||||||
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
|
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
|
||||||
|
|||||||
Reference in New Issue
Block a user