Fix token orders crash

This commit is contained in:
jl777
2018-07-25 20:18:29 -11:00
parent 334687197b
commit 19da5c6446
2 changed files with 16 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ UniValue AssetOrders(uint256 refassetid)
txid = it->first.txhash;
if ( GetTransaction(txid,vintx,hashBlock,false) != 0 )
{
if ( (funcid= DecodeAssetOpRet(vintx.vout[vintx.vout.size()-1].scriptPubKey,assetid,assetid2,price,origpubkey)) != 0 )
if ( vintx.vout.size() > 0 && (funcid= DecodeAssetOpRet(vintx.vout[vintx.vout.size()-1].scriptPubKey,assetid,assetid2,price,origpubkey)) != 0 )
{
if ( refassetid != zero && assetid != refassetid )
{