This commit is contained in:
@@ -52,7 +52,7 @@ one other technical note is that komodod has the insight-explorer extensions bui
|
|||||||
#include "../utlist.h"
|
#include "../utlist.h"
|
||||||
#include "../uthash.h"
|
#include "../uthash.h"
|
||||||
|
|
||||||
|
#define CC_BURNPUBKEY "02deaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead"
|
||||||
#define CC_MAXVINS 1024
|
#define CC_MAXVINS 1024
|
||||||
|
|
||||||
#define SMALLVAL 0.000000000000001
|
#define SMALLVAL 0.000000000000001
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ bool TokensExactAmounts(bool goDeeper, struct CCcontract_info *cp, int64_t &inpu
|
|||||||
if (inputs != outputs) {
|
if (inputs != outputs) {
|
||||||
if (tx.GetHash() != reftokenid)
|
if (tx.GetHash() != reftokenid)
|
||||||
LOGSTREAM((char *)"cctokens", CCLOG_DEBUG1, stream << indentStr << "TokenExactAmounts() found unequal token cc inputs=" << inputs << " vs cc outputs=" << outputs << " for txid=" << tx.GetHash().GetHex() << " and this is not the create tx" << std::endl);
|
LOGSTREAM((char *)"cctokens", CCLOG_DEBUG1, stream << indentStr << "TokenExactAmounts() found unequal token cc inputs=" << inputs << " vs cc outputs=" << outputs << " for txid=" << tx.GetHash().GetHex() << " and this is not the create tx" << std::endl);
|
||||||
fprintf(stderr,"inputs %llu vs outputs %llu\n",(long long)inputs,(long long)outputs);
|
//fprintf(stderr,"inputs %llu vs outputs %llu\n",(long long)inputs,(long long)outputs);
|
||||||
return false; // do not call eval->Invalid() here!
|
return false; // do not call eval->Invalid() here!
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -656,10 +656,11 @@ UniValue rogue_register(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
|
|||||||
// vin3+ -> buyin
|
// vin3+ -> buyin
|
||||||
// vout0 -> keystrokes/completion baton
|
// vout0 -> keystrokes/completion baton
|
||||||
CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight());
|
CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight());
|
||||||
UniValue result(UniValue::VOBJ); char destaddr[64],coinaddr[64]; uint256 gametxid,origplayergame,playertxid,hashBlock; int32_t err,maxplayers,gameheight,n,numvouts; int64_t inputsum,buyin,CCchange=0; CPubKey pk,mypk,roguepk; CTransaction tx,playertx; std::vector<uint8_t> playerdata; std::string rawtx; bits256 t;
|
UniValue result(UniValue::VOBJ); char destaddr[64],coinaddr[64]; uint256 gametxid,origplayergame,playertxid,hashBlock; int32_t err,maxplayers,gameheight,n,numvouts; int64_t inputsum,buyin,CCchange=0; CPubKey pk,mypk,roguepk,burnpk; CTransaction tx,playertx; std::vector<uint8_t> playerdata; std::string rawtx; bits256 t;
|
||||||
if ( txfee == 0 )
|
if ( txfee == 0 )
|
||||||
txfee = 10000;
|
txfee = 10000;
|
||||||
mypk = pubkey2pk(Mypubkey());
|
mypk = pubkey2pk(Mypubkey());
|
||||||
|
burnpk = pubkey2pk(ParseHex(CC_BURNPUBKEY));
|
||||||
roguepk = GetUnspendable(cp,0);
|
roguepk = GetUnspendable(cp,0);
|
||||||
rogue_univalue(result,"register",-1,-1);
|
rogue_univalue(result,"register",-1,-1);
|
||||||
playertxid = zeroid;
|
playertxid = zeroid;
|
||||||
@@ -691,13 +692,13 @@ UniValue rogue_register(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
|
|||||||
mtx.vout.push_back(MakeCC1of2vout(cp->evalcode,buyin + inputsum - txfee,roguepk,mypk));
|
mtx.vout.push_back(MakeCC1of2vout(cp->evalcode,buyin + inputsum - txfee,roguepk,mypk));
|
||||||
GetCCaddress1of2(cp,destaddr,roguepk,roguepk);
|
GetCCaddress1of2(cp,destaddr,roguepk,roguepk);
|
||||||
CCaddr1of2set(cp,roguepk,roguepk,cp->CCpriv,destaddr);
|
CCaddr1of2set(cp,roguepk,roguepk,cp->CCpriv,destaddr);
|
||||||
mtx.vout.push_back(MakeTokensCC1vout(cp->evalcode, 1, mypk));//CPubKey() /*nullpk*/));
|
mtx.vout.push_back(MakeTokensCC1vout(cp->evalcode, 1, burnpk));
|
||||||
|
|
||||||
std::vector<uint8_t> vopretFinish, vopret2; uint8_t e, f; uint256 tokenid; std::vector<CPubKey> voutPubkeys, voutPubkeysEmpty; int32_t didtx = 0;
|
std::vector<uint8_t> vopretFinish, vopret2; uint8_t e, f; uint256 tokenid; std::vector<CPubKey> voutPubkeys, voutPubkeysEmpty; int32_t didtx = 0;
|
||||||
CScript opretRegister = rogue_registeropret(gametxid, playertxid);
|
CScript opretRegister = rogue_registeropret(gametxid, playertxid);
|
||||||
if ( playertxid != zeroid )
|
if ( playertxid != zeroid )
|
||||||
{
|
{
|
||||||
voutPubkeysEmpty.push_back(mypk);
|
voutPubkeysEmpty.push_back(burnpk);
|
||||||
if ( GetTransaction(playertxid,playertx,hashBlock,false) != 0 )
|
if ( GetTransaction(playertxid,playertx,hashBlock,false) != 0 )
|
||||||
{
|
{
|
||||||
if ( DecodeTokenOpRet(playertx.vout.back().scriptPubKey, e, tokenid, voutPubkeys, vopretFinish, vopret2) != 0)
|
if ( DecodeTokenOpRet(playertx.vout.back().scriptPubKey, e, tokenid, voutPubkeys, vopretFinish, vopret2) != 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user