Add oraclessample rpc to get data for txid.

This commit is contained in:
Mihailo Milenkovic
2019-06-15 15:36:04 +02:00
parent 9f07adc526
commit 40ec8b3bac
5 changed files with 49 additions and 0 deletions

View File

@@ -6830,6 +6830,20 @@ UniValue oraclessubscribe(const UniValue& params, bool fHelp)
return(result);
}
UniValue oraclessample(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ); uint256 oracletxid,txid; int32_t num; char *batonaddr;
if ( fHelp || params.size() != 2 )
throw runtime_error("oraclessample oracletxid txid\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
oracletxid = Parseuint256((char *)params[0].get_str().c_str());
txid = Parseuint256((char *)params[1].get_str().c_str());
return(OracleDataSample(oracletxid,txid));
}
UniValue oraclessamples(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ); uint256 txid; int32_t num; char *batonaddr;