Fix
This commit is contained in:
@@ -332,7 +332,7 @@ cJSON *get_komodocli(char *refcoin,char **retstrp,char *acname,char *method,char
|
|||||||
if ( (jsonstr= filestr(&fsize,fname)) != 0 )
|
if ( (jsonstr= filestr(&fsize,fname)) != 0 )
|
||||||
{
|
{
|
||||||
jsonstr[strlen(jsonstr)-1]='\0';
|
jsonstr[strlen(jsonstr)-1]='\0';
|
||||||
fprintf(stderr,"%s -> jsonstr.(%s)\n",cmdstr,jsonstr);
|
//fprintf(stderr,"%s -> jsonstr.(%s)\n",cmdstr,jsonstr);
|
||||||
if ( (jsonstr[0] != '{' && jsonstr[0] != '[') || (retjson= cJSON_Parse(jsonstr)) == 0 )
|
if ( (jsonstr[0] != '{' && jsonstr[0] != '[') || (retjson= cJSON_Parse(jsonstr)) == 0 )
|
||||||
*retstrp = jsonstr;
|
*retstrp = jsonstr;
|
||||||
else free(jsonstr);
|
else free(jsonstr);
|
||||||
|
|||||||
@@ -964,13 +964,13 @@ std::string GatewaysPartialSign(uint64_t txfee,uint256 txid,std::string refcoin,
|
|||||||
mypk = pubkey2pk(Mypubkey());
|
mypk = pubkey2pk(Mypubkey());
|
||||||
txidaddrpk=CCtxidaddr(txidaddr,txid);
|
txidaddrpk=CCtxidaddr(txidaddr,txid);
|
||||||
SetCCunspents(unspentOutputs,txidaddr);
|
SetCCunspents(unspentOutputs,txidaddr);
|
||||||
|
maxK=0;
|
||||||
if (unspentOutputs.size()==0)
|
if (unspentOutputs.size()==0)
|
||||||
{
|
{
|
||||||
if (AddNormalinputs(mtx,mypk,2*txfee,2)==0) fprintf(stderr,"error adding funds for partialsign\n");
|
if (AddNormalinputs(mtx,mypk,2*txfee,2)==0) fprintf(stderr,"error adding funds for partialsign\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
maxK=0;
|
|
||||||
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
||||||
{
|
{
|
||||||
tmptxid = it->first.txhash;
|
tmptxid = it->first.txhash;
|
||||||
@@ -985,6 +985,6 @@ std::string GatewaysPartialSign(uint64_t txfee,uint256 txid,std::string refcoin,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mtx.vout.push_back(CTxOut(5000,CScript() << ParseHex(HexStr(txidaddrpk)) << OP_CHECKSIG));
|
mtx.vout.push_back(CTxOut(5000,CScript() << ParseHex(HexStr(txidaddrpk)) << OP_CHECKSIG));
|
||||||
opret << OP_RETURN << E_MARSHAL(ss << cp->evalcode << 'P' << K+1 << mypk << refcoin << hex);
|
opret << OP_RETURN << E_MARSHAL(ss << cp->evalcode << 'P' << maxK+1 << mypk << refcoin << hex);
|
||||||
return(FinalizeCCTx(0,cp,mtx,mypk,txfee,opret));
|
return(FinalizeCCTx(0,cp,mtx,mypk,txfee,opret));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user