Require tokenid for remaining

This commit is contained in:
jl777
2018-10-01 02:37:21 -11:00
parent 72968af153
commit bd59ecd6cd
2 changed files with 2 additions and 2 deletions

View File

@@ -426,7 +426,7 @@ UniValue GatewaysInfo(uint256 bindtxid)
result.push_back(Pair("tokenid",uint256_str(str,tokenid)));
sprintf(numstr,"%.8f",(double)totalsupply/COIN);
result.push_back(Pair("totalsupply",numstr));
remaining = CCaddress_balance(gatewaysassets);
remaining = CCtoken_balance(gatewaysassets,tokenid);
sprintf(numstr,"%.8f",(double)remaining/COIN);
result.push_back(Pair("remaining",numstr));
sprintf(numstr,"%.8f",(double)(totalsupply - remaining)/COIN);

View File

@@ -477,7 +477,7 @@ int32_t gettxout_scriptPubKey(uint8_t *scriptPubKey,int32_t maxsize,uint256 txid
uint256 hashBlock;
if ( GetTransaction(txid,tx,hashBlock,false) == 0 )
return(-1);
else if ( n <= tx.vout.size() ) // vout.size() seems off by 1
else if ( n < tx.vout.size() )
{
ptr = (uint8_t *)tx.vout[n].scriptPubKey.data();
m = tx.vout[n].scriptPubKey.size();