corr cond (single tokens) for buy in GetAssetorigaddrs
This commit is contained in:
@@ -379,8 +379,11 @@ bool GetAssetorigaddrs(struct CCcontract_info *cp, char *CCaddr, char *destaddr,
|
|||||||
bool bGetCCaddr = false;
|
bool bGetCCaddr = false;
|
||||||
if (funcid == 's' || funcid == 'S')
|
if (funcid == 's' || funcid == 'S')
|
||||||
bGetCCaddr = GetTokensCCaddress(cp, CCaddr, pubkey2pk(origpubkey));
|
bGetCCaddr = GetTokensCCaddress(cp, CCaddr, pubkey2pk(origpubkey));
|
||||||
else if (funcid == 'b' || funcid == 'B')
|
else if (funcid == 'b' || funcid == 'B') {
|
||||||
bGetCCaddr = GetCCaddress(cp, CCaddr, pubkey2pk(origpubkey));
|
struct CCcontract_info *cpTokens, tokensC;
|
||||||
|
cpTokens = CCinit(&tokensC, EVAL_TOKENS);
|
||||||
|
bGetCCaddr = GetCCaddress(cpTokens, CCaddr, pubkey2pk(origpubkey));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << "GetAssetorigaddrs incorrect funcid=" << (char)(funcid?funcid:' ') << std::endl;
|
std::cerr << "GetAssetorigaddrs incorrect funcid=" << (char)(funcid?funcid:' ') << std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -723,8 +723,8 @@ std::string FillSell(int64_t txfee, uint256 assetid, uint256 assetid2, uint256 a
|
|||||||
if (assetid2 != zeroid && inputs > paid_nValue)
|
if (assetid2 != zeroid && inputs > paid_nValue)
|
||||||
CCchange = (inputs - paid_nValue);
|
CCchange = (inputs - paid_nValue);
|
||||||
|
|
||||||
mtx.vout.push_back(MakeTokensCC1vout(EVAL_ASSETS, orig_assetoshis - received_assetoshis, GetUnspendable(cpAssets, NULL))); // vout.0 tokens cc addr - ask remainder
|
mtx.vout.push_back(MakeTokensCC1vout(EVAL_ASSETS, orig_assetoshis - received_assetoshis, GetUnspendable(cpAssets, NULL))); // vout.0 tokens remainder to unspendable cc addr
|
||||||
mtx.vout.push_back(MakeTokensCC1vout(EVAL_ASSETS, received_assetoshis, mypk)); //vout.1 tokens to self
|
mtx.vout.push_back(MakeTokensCC1vout(EVAL_ASSETS, received_assetoshis, mypk)); //vout.1 purchased tokens to self
|
||||||
|
|
||||||
// NOTE: no marker here
|
// NOTE: no marker here
|
||||||
|
|
||||||
@@ -735,7 +735,7 @@ std::string FillSell(int64_t txfee, uint256 assetid, uint256 assetid2, uint256 a
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << "FillSell() paid_value=" << paid_nValue << " origpubkey=" << HexStr(pubkey2pk(origpubkey)) << std::endl;
|
std::cerr << "FillSell() paid_value=" << paid_nValue << " origpubkey=" << HexStr(pubkey2pk(origpubkey)) << std::endl;
|
||||||
mtx.vout.push_back(CTxOut(paid_nValue, CScript() << origpubkey << OP_CHECKSIG)); //vout.2 coins normal to whom who asked token
|
mtx.vout.push_back(CTxOut(paid_nValue, CScript() << origpubkey << OP_CHECKSIG)); //vout.2 coins to tokens seller's normal addr
|
||||||
}
|
}
|
||||||
|
|
||||||
// not implemented
|
// not implemented
|
||||||
|
|||||||
Reference in New Issue
Block a user