This commit is contained in:
@@ -175,11 +175,11 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Getscriptaddress(destaddr,vintx.vout[utxovout].scriptPubKey);
|
Getscriptaddress(destaddr,vintx.vout[utxovout].scriptPubKey);
|
||||||
fprintf(stderr,"FinalizeCCTx() vin.%d is CC %.8f -> (%s) vs %s\n",i,(double)utxovalues[i]/COIN,destaddr,cp->tokens1of2addr);
|
fprintf(stderr,"FinalizeCCTx() vin.%d is CC %.8f -> (%s) vs %s\n",i,(double)utxovalues[i]/COIN,destaddr,cp->mysingletokensaddr);
|
||||||
//std::cerr << "FinalizeCCtx() searching destaddr=" << destaddr << " for vin[" << i << "] satoshis=" << utxovalues[i] << std::endl;
|
//std::cerr << "FinalizeCCtx() searching destaddr=" << destaddr << " for vin[" << i << "] satoshis=" << utxovalues[i] << std::endl;
|
||||||
if( strcmp(destaddr, myaddr) == 0 )
|
if( strcmp(destaddr, myaddr) == 0 )
|
||||||
{
|
{
|
||||||
//fprintf(stderr, "FinalizeCCTx() matched cc myaddr (%s)\n", myaddr);
|
fprintf(stderr, "FinalizeCCTx() matched cc myaddr (%s)\n", myaddr);
|
||||||
privkey = myprivkey;
|
privkey = myprivkey;
|
||||||
cond = mycond;
|
cond = mycond;
|
||||||
}
|
}
|
||||||
@@ -187,30 +187,30 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
{
|
{
|
||||||
privkey = myprivkey;
|
privkey = myprivkey;
|
||||||
cond = mytokenscond;
|
cond = mytokenscond;
|
||||||
//fprintf(stderr,"FinalizeCCTx() matched dual-eval TokensCC1vout my token addr.(%s)\n",mytokensaddr);
|
fprintf(stderr,"FinalizeCCTx() matched dual-eval TokensCC1vout my token addr.(%s)\n",mytokensaddr);
|
||||||
}
|
}
|
||||||
else if (strcmp(destaddr, mysingletokensaddr) == 0) // if this is TokensCC1vout
|
else if (strcmp(destaddr, mysingletokensaddr) == 0) // if this is TokensCC1vout
|
||||||
{
|
{
|
||||||
privkey = myprivkey;
|
privkey = myprivkey;
|
||||||
cond = mysingletokenscond;
|
cond = mysingletokenscond;
|
||||||
//fprintf(stderr, "FinalizeCCTx() matched single-eval token CC1vout my token addr.(%s)\n", mytokensaddr);
|
fprintf(stderr, "FinalizeCCTx() matched single-eval token CC1vout my token addr.(%s)\n", mytokensaddr);
|
||||||
}
|
}
|
||||||
else if ( strcmp(destaddr,unspendable) == 0 )
|
else if ( strcmp(destaddr,unspendable) == 0 )
|
||||||
{
|
{
|
||||||
privkey = unspendablepriv;
|
privkey = unspendablepriv;
|
||||||
cond = othercond;
|
cond = othercond;
|
||||||
//fprintf(stderr,"FinalizeCCTx evalcode(%d) matched unspendable CC addr.(%s)\n",cp->evalcode,unspendable);
|
fprintf(stderr,"FinalizeCCTx evalcode(%d) matched unspendable CC addr.(%s)\n",cp->evalcode,unspendable);
|
||||||
}
|
}
|
||||||
else if (strcmp(destaddr, unspendabletokensaddr) == 0)
|
else if (strcmp(destaddr, unspendabletokensaddr) == 0)
|
||||||
{
|
{
|
||||||
privkey = unspendablepriv;
|
privkey = unspendablepriv;
|
||||||
cond = othertokenscond;
|
cond = othertokenscond;
|
||||||
//fprintf(stderr,"FinalizeCCTx() matched unspendabletokensaddr dual/three-eval CC addr.(%s)\n",unspendabletokensaddr);
|
fprintf(stderr,"FinalizeCCTx() matched unspendabletokensaddr dual/three-eval CC addr.(%s)\n",unspendabletokensaddr);
|
||||||
}
|
}
|
||||||
// check if this is the 2nd additional evalcode + 'unspendable' cc addr:
|
// check if this is the 2nd additional evalcode + 'unspendable' cc addr:
|
||||||
else if ( strcmp(destaddr, cp->unspendableaddr2) == 0)
|
else if ( strcmp(destaddr, cp->unspendableaddr2) == 0)
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"FinalizeCCTx() matched %s unspendable2!\n",cp->unspendableaddr2);
|
fprintf(stderr,"FinalizeCCTx() matched %s unspendable2!\n",cp->unspendableaddr2);
|
||||||
privkey = cp->unspendablepriv2;
|
privkey = cp->unspendablepriv2;
|
||||||
if( othercond2 == 0 )
|
if( othercond2 == 0 )
|
||||||
othercond2 = MakeCCcond1(cp->unspendableEvalcode2, cp->unspendablepk2);
|
othercond2 = MakeCCcond1(cp->unspendableEvalcode2, cp->unspendablepk2);
|
||||||
@@ -219,7 +219,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
// check if this is 3rd additional evalcode + 'unspendable' cc addr:
|
// check if this is 3rd additional evalcode + 'unspendable' cc addr:
|
||||||
else if ( strcmp(destaddr,cp->unspendableaddr3) == 0 )
|
else if ( strcmp(destaddr,cp->unspendableaddr3) == 0 )
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"FinalizeCCTx() matched %s unspendable3!\n",cp->unspendableaddr3);
|
fprintf(stderr,"FinalizeCCTx() matched %s unspendable3!\n",cp->unspendableaddr3);
|
||||||
privkey = cp->unspendablepriv3;
|
privkey = cp->unspendablepriv3;
|
||||||
if( othercond3 == 0 )
|
if( othercond3 == 0 )
|
||||||
othercond3 = MakeCCcond1(cp->unspendableEvalcode3, cp->unspendablepk3);
|
othercond3 = MakeCCcond1(cp->unspendableEvalcode3, cp->unspendablepk3);
|
||||||
@@ -228,7 +228,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
// check if this is spending from 1of2 cc coins addr:
|
// check if this is spending from 1of2 cc coins addr:
|
||||||
else if (strcmp(cp->coins1of2addr, destaddr) == 0)
|
else if (strcmp(cp->coins1of2addr, destaddr) == 0)
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"FinalizeCCTx() matched %s unspendable1of2!\n",cp->coins1of2addr);
|
fprintf(stderr,"FinalizeCCTx() matched %s unspendable1of2!\n",cp->coins1of2addr);
|
||||||
privkey = cp->coins1of2priv;//myprivkey;
|
privkey = cp->coins1of2priv;//myprivkey;
|
||||||
if (othercond1of2 == 0)
|
if (othercond1of2 == 0)
|
||||||
othercond1of2 = MakeCCcond1of2(cp->evalcode, cp->coins1of2pk[0], cp->coins1of2pk[1]);
|
othercond1of2 = MakeCCcond1of2(cp->evalcode, cp->coins1of2pk[0], cp->coins1of2pk[1]);
|
||||||
@@ -236,7 +236,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
}
|
}
|
||||||
else if ( strcmp(CC1of2CCaddr,destaddr) == 0 )
|
else if ( strcmp(CC1of2CCaddr,destaddr) == 0 )
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"FinalizeCCTx() matched %s CC1of2CCaddr!\n",CC1of2CCaddr);
|
fprintf(stderr,"FinalizeCCTx() matched %s CC1of2CCaddr!\n",CC1of2CCaddr);
|
||||||
privkey = unspendablepriv;
|
privkey = unspendablepriv;
|
||||||
if (condCC2 == 0)
|
if (condCC2 == 0)
|
||||||
condCC2 = MakeCCcond1of2(cp->evalcode,unspendablepk,unspendablepk);
|
condCC2 = MakeCCcond1of2(cp->evalcode,unspendablepk,unspendablepk);
|
||||||
@@ -270,7 +270,8 @@ fprintf(stderr,"FinalizeCCTx() matched %s cp->tokens1of2addr!\n", cp->tokens1of2
|
|||||||
cond = othercond4;
|
cond = othercond4;
|
||||||
flag = 1;
|
flag = 1;
|
||||||
}
|
}
|
||||||
}
|
} //else privkey = myprivkey;
|
||||||
|
|
||||||
if ( flag == 0 )
|
if ( flag == 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"CC signing error: vini.%d has unknown CC address.(%s)\n",i,destaddr);
|
fprintf(stderr,"CC signing error: vini.%d has unknown CC address.(%s)\n",i,destaddr);
|
||||||
|
|||||||
Reference in New Issue
Block a user