Prevent bid for nonexistent assetid
This commit is contained in:
@@ -198,12 +198,17 @@ std::string AssetTransfer(int64_t txfee,uint256 assetid,std::vector<uint8_t> des
|
|||||||
|
|
||||||
std::string CreateBuyOffer(int64_t txfee,int64_t bidamount,uint256 assetid,int64_t pricetotal)
|
std::string CreateBuyOffer(int64_t txfee,int64_t bidamount,uint256 assetid,int64_t pricetotal)
|
||||||
{
|
{
|
||||||
CMutableTransaction mtx; CPubKey mypk; struct CCcontract_info *cp,C;
|
CMutableTransaction mtx; CPubKey mypk; struct CCcontract_info *cp,C; uint256 hashBlock; CTransaction vintx;
|
||||||
if ( bidamount < 0 || pricetotal < 0 )
|
if ( bidamount < 0 || pricetotal < 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"negative bidamount %lld, pricetotal %lld\n",(long long)bidamount,(long long)pricetotal);
|
fprintf(stderr,"negative bidamount %lld, pricetotal %lld\n",(long long)bidamount,(long long)pricetotal);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
if ( GetTransaction(assetid,vintx,hashBlock,false) == 0 )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"cant find assetid\n");
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
cp = CCinit(&C,EVAL_ASSETS);
|
cp = CCinit(&C,EVAL_ASSETS);
|
||||||
if ( txfee == 0 )
|
if ( txfee == 0 )
|
||||||
txfee = 10000;
|
txfee = 10000;
|
||||||
|
|||||||
Reference in New Issue
Block a user