Oraclessubscribe with float

This commit is contained in:
jl777
2018-09-04 06:59:51 -11:00
parent 4040391ffe
commit d95908b80b
2 changed files with 4 additions and 3 deletions

View File

@@ -310,7 +310,8 @@ uint64_t get_btcusd()
}
// oraclescreate "BTCUSD" "coindeskpricedata" "L" -> 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3
// oraclesregister 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3 1000000
// oraclesregister 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3 1000000 -> 11c54d4ab17293217276396e27d86f714576ff55a3300dac34417047825edf93
// oraclessubscribe 4895f631316a649e216153aee7a574bd281686265dc4e8d37597f72353facac3 11c54d4ab17293217276396e27d86f714576ff55a3300dac34417047825edf93 1
int32_t main(int32_t argc,char **argv)
{

View File

@@ -5408,12 +5408,12 @@ UniValue oraclessubscribe(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ); uint256 txid; int64_t amount; std::string hex; std::vector<unsigned char> pubkey;
if ( fHelp || params.size() != 3 )
throw runtime_error("oraclessubscribe oracletxid publisher datafee\n");
throw runtime_error("oraclessubscribe oracletxid publisher amount\n");
if ( ensure_CCrequirements() < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
txid = Parseuint256((char *)params[0].get_str().c_str());
pubkey = ParseHex(params[1].get_str().c_str());
amount = atol((char *)params[2].get_str().c_str());
amount = atof((char *)params[2].get_str().c_str()) * COIN;
hex = OracleSubscribe(0,txid,pubkey2pk(pubkey),amount);
if ( hex.size() > 0 )
{