added othertokenscond to FinalizeCCtx

This commit is contained in:
dimxy
2019-01-16 12:12:41 +05:00
parent ee848abde9
commit a7833f272f
2 changed files with 25 additions and 7 deletions

View File

@@ -618,7 +618,7 @@ std::string FillBuyOffer(int64_t txfee,uint256 assetid,uint256 bidtxid,int64_t f
//CPubKey unspendableTokensPk = GetUnspendable(cpTokens, NULL);
uint8_t unspendableAssetsPrivkey[32];
cpTokens = CCinit(&assetsC, EVAL_ASSETS);
cpTokens = CCinit(&assetsC, EVAL_ASSETS); //???
CPubKey unspendableAssetsPk = GetUnspendable(cpAssets, unspendableAssetsPrivkey);
mtx.vout.push_back(MakeCC1vout(EVAL_ASSETS, bidamount - paid_amount, unspendableAssetsPk)); // vout0 coins remainder
@@ -742,6 +742,15 @@ std::string FillSell(int64_t txfee,uint256 assetid,uint256 assetid2,uint256 askt
//mtx.vout.push_back(MakeCC1vout(EVAL_ASSETS, CCchange, mypk)); //vout.3 coins in Assets cc addr (swap not implemented)
}
uint8_t unspendableAssetsPrivkey[32];
char unspendableAssetsAddr[64];
// init 'unspenable' privkey and pubkey
CPubKey unspendableAssetsPk = GetUnspendable(cpAssets, unspendableAssetsPrivkey);
GetCCaddress(cpAssets, unspendableAssetsAddr, unspendableAssetsPk);
// add additional unspendable addr from Assets:
CCaddr2set(cpAssets, EVAL_ASSETS, unspendableAssetsPk, unspendableAssetsPrivkey, unspendableAssetsAddr);
// vout verification pubkeys:
std::vector<CPubKey> voutTokenPubkeys;
voutTokenPubkeys.push_back(mypk);