Merge branch 'FSM' into jl777
This commit is contained in:
@@ -924,14 +924,13 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector <uint8_t> da
|
||||
|
||||
UniValue OracleFormat(uint8_t *data,int32_t datalen,char *format,int32_t formatlen)
|
||||
{
|
||||
UniValue obj(UniValue::VARR); uint256 hash; int32_t i,j=0; int64_t val; char str[IGUANA_MAXSCRIPTSIZE*2+1];
|
||||
uint256 hash; int32_t i,j=0; int64_t val; char str[IGUANA_MAXSCRIPTSIZE*2+1];
|
||||
for (i=0; i<formatlen && j<datalen; i++)
|
||||
{
|
||||
str[0] = 0;
|
||||
j = oracle_format(&hash,&val,str,format[i],data,j,datalen);
|
||||
if ( j < 0 )
|
||||
break;
|
||||
obj.push_back(str);
|
||||
if ( j >= datalen )
|
||||
break;
|
||||
}
|
||||
@@ -954,9 +953,9 @@ UniValue OracleDataSamples(uint256 reforacletxid,uint256 batontxid,int32_t num)
|
||||
{
|
||||
if ( (formatstr= (char *)format.c_str()) == 0 )
|
||||
formatstr = (char *)"";
|
||||
UniValue a(UniValue::VARR);
|
||||
a.push_back(OracleFormat((uint8_t *)data.data(),(int32_t)data.size(),formatstr,(int32_t)format.size()));
|
||||
a.push_back(uint256_str(str,batontxid));
|
||||
UniValue a(UniValue::VOBJ);
|
||||
a.push_back(Pair("data",OracleFormat((uint8_t *)data.data(),(int32_t)data.size(),formatstr,(int32_t)format.size())));
|
||||
a.push_back(Pair("txid",uint256_str(str,batontxid)));
|
||||
b.push_back(a);
|
||||
batontxid = btxid;
|
||||
if ( ++n >= num && num != 0)
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern int32_t KOMODO_INSYNC;
|
||||
extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
|
||||
void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
|
||||
#include "komodo_defs.h"
|
||||
@@ -1689,6 +1690,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.push_back(Pair("chain", Params().NetworkIDString()));
|
||||
obj.push_back(Pair("blocks", (int)chainActive.Height()));
|
||||
obj.push_back(Pair("synced", KOMODO_INSYNC!=0));
|
||||
obj.push_back(Pair("headers", pindexBestHeader ? pindexBestHeader->GetHeight() : -1));
|
||||
obj.push_back(Pair("bestblockhash", chainActive.LastTip()->GetBlockHash().GetHex()));
|
||||
obj.push_back(Pair("difficulty", (double)GetNetworkDifficulty()));
|
||||
@@ -2082,4 +2084,4 @@ void RegisterBlockchainRPCCommands(CRPCTable &tableRPC)
|
||||
{
|
||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
|
||||
tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ bool komodo_txnotarizedconfirmed(uint256 txid);
|
||||
uint32_t komodo_chainactive_timestamp();
|
||||
int32_t komodo_whoami(char *pubkeystr,int32_t height,uint32_t timestamp);
|
||||
extern uint64_t KOMODO_INTERESTSUM,KOMODO_WALLETBALANCE;
|
||||
extern int32_t KOMODO_LASTMINED,JUMBLR_PAUSE,KOMODO_LONGESTCHAIN,IS_STAKED_NOTARY,IS_KOMODO_NOTARY,STAKED_ERA;
|
||||
extern int32_t KOMODO_LASTMINED,JUMBLR_PAUSE,KOMODO_LONGESTCHAIN,IS_STAKED_NOTARY,IS_KOMODO_NOTARY,STAKED_ERA,KOMODO_INSYNC;
|
||||
extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
|
||||
uint32_t komodo_segid32(char *coinaddr);
|
||||
int64_t komodo_coinsupply(int64_t *zfundsp,int64_t *sproutfundsp,int32_t height);
|
||||
@@ -237,6 +237,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
|
||||
obj.push_back(Pair("version", CLIENT_VERSION));
|
||||
obj.push_back(Pair("protocolversion", PROTOCOL_VERSION));
|
||||
obj.push_back(Pair("KMDversion", KOMODO_VERSION));
|
||||
obj.push_back(Pair("synced", KOMODO_INSYNC!=0));
|
||||
//obj.push_back(Pair("VRSCversion", VERUS_VERSION));
|
||||
obj.push_back(Pair("notarized", notarized_height));
|
||||
obj.push_back(Pair("prevMoMheight", prevMoMheight));
|
||||
|
||||
@@ -70,6 +70,7 @@ extern std::string ASSETCHAINS_OVERRIDE_PUBKEY;
|
||||
const std::string ADDR_TYPE_SPROUT = "sprout";
|
||||
const std::string ADDR_TYPE_SAPLING = "sapling";
|
||||
extern UniValue TxJoinSplitToJSON(const CTransaction& tx);
|
||||
extern int32_t KOMODO_INSYNC;
|
||||
uint32_t komodo_segid32(char *coinaddr);
|
||||
int32_t komodo_dpowconfs(int32_t height,int32_t numconfs);
|
||||
int32_t komodo_isnotaryvout(char *coinaddr,uint32_t tiptime); // from ac_private chains only
|
||||
@@ -84,6 +85,7 @@ UniValue z_getoperationstatus_IMPL(const UniValue&, bool);
|
||||
|
||||
#define PLAN_NAME_MAX 8
|
||||
#define VALID_PLAN_NAME(x) (strlen(x) <= PLAN_NAME_MAX)
|
||||
#define THROW_IF_SYNCING(INSYNC) if (INSYNC == 0) { throw runtime_error(strprintf("%s: Chain still syncing at height %d, aborting to prevent linkability analysis!",__FUNCTION__,chainActive.Tip()->GetHeight())); }
|
||||
|
||||
int tx_height( const uint256 &hash );
|
||||
|
||||
@@ -4247,6 +4249,8 @@ UniValue z_sendmany(const UniValue& params, bool fHelp)
|
||||
+ HelpExampleRpc("z_sendmany", "\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\", [{\"address\": \"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\" ,\"amount\": 5.0}]")
|
||||
);
|
||||
|
||||
THROW_IF_SYNCING(KOMODO_INSYNC);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
// Check that the from address is valid.
|
||||
@@ -4556,6 +4560,8 @@ UniValue z_shieldcoinbase(const UniValue& params, bool fHelp)
|
||||
+ HelpExampleRpc("z_shieldcoinbase", "\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\", \"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\"")
|
||||
);
|
||||
|
||||
THROW_IF_SYNCING(KOMODO_INSYNC);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
// Validate the from address
|
||||
@@ -4816,6 +4822,8 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp)
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Error: z_mergetoaddress is disabled.");
|
||||
}
|
||||
|
||||
THROW_IF_SYNCING(KOMODO_INSYNC);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
bool useAnyUTXO = false;
|
||||
|
||||
Reference in New Issue
Block a user