Browse Source

.

z_createrawtransaction
blackjok3r 5 years ago
parent
commit
b5910e55c7
  1. 12
      src/cc/payments.cpp
  2. 2
      src/init.cpp
  3. 2
      src/main.cpp
  4. 4
      src/wallet/rpcwallet.cpp

12
src/cc/payments.cpp

@ -894,16 +894,16 @@ UniValue PaymentsFund(struct CCcontract_info *cp,char *jsonstr)
mtx.vout.push_back(MakeCC1vout(EVAL_PAYMENTS,amount,Paymentspk));
opret = EncodePaymentsFundOpRet(txid);
// Use the below one along with other FinalizeCCTx/return, to get the ccvout scriptpubkey
/*std::vector<std::vector<unsigned char>> vData = std::vector<std::vector<unsigned char>>();
std::vector<std::vector<unsigned char>> vData = std::vector<std::vector<unsigned char>>();
if ( makeCCopret(opret, vData) )
mtx.vout.push_back(MakeCC1vout(EVAL_PAYMENTS,amount,Paymentspk,&vData)); */
mtx.vout.push_back(MakeCC1vout(EVAL_PAYMENTS,amount,Paymentspk,&vData));
}
rawtx = FinalizeCCTx(0,cp,mtx,mypk,PAYMENTS_TXFEE,opret);
//rawtx = FinalizeCCTx(0,cp,mtx,mypk,PAYMENTS_TXFEE,CScript()); // use this one to get ccvout scriptpubkey.
//rawtx = FinalizeCCTx(0,cp,mtx,mypk,PAYMENTS_TXFEE,opret);
rawtx = FinalizeCCTx(0,cp,mtx,mypk,PAYMENTS_TXFEE,CScript()); // use this one to get ccvout scriptpubkey.
if ( params != 0 )
free_json(params);
//return(payments_rawtxresult(result,rawtx,0)); // disable sending for CCvout, as we only need to decode the tx.
return(payments_rawtxresult(result,rawtx,1));
return(payments_rawtxresult(result,rawtx,0)); // disable sending for CCvout, as we only need to decode the tx.
//return(payments_rawtxresult(result,rawtx,1));
}
else
{

2
src/init.cpp

@ -1627,7 +1627,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
break;
}
if ( ASSETCHAINS_CC != 0 && KOMODO_SNAPSHOT_INTERVAL != 0 && chainActive.Height() > KOMODO_SNAPSHOT_INTERVAL )
if ( ASSETCHAINS_CC != 0 && KOMODO_SNAPSHOT_INTERVAL != 0 && chainActive.Height() >= KOMODO_SNAPSHOT_INTERVAL )
{
if ( !komodo_dailysnapshot(chainActive.Height()) )
{

2
src/main.cpp

@ -4251,7 +4251,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
komodo_pricesupdate(pindexNew->GetHeight(),pblock);
if ( ASSETCHAINS_SAPLING <= 0 && pindexNew->nTime > KOMODO_SAPLING_ACTIVATION - 24*3600 )
komodo_activate_sapling(pindexNew);
if ( ASSETCHAINS_CC != 0 && KOMODO_SNAPSHOT_INTERVAL != 0 && (pindexNew->GetHeight() % KOMODO_SNAPSHOT_INTERVAL) == 0 && pindexNew->GetHeight() > KOMODO_SNAPSHOT_INTERVAL )
if ( ASSETCHAINS_CC != 0 && KOMODO_SNAPSHOT_INTERVAL != 0 && (pindexNew->GetHeight() % KOMODO_SNAPSHOT_INTERVAL) == 0 && pindexNew->GetHeight() >= KOMODO_SNAPSHOT_INTERVAL )
{
uint64_t start = time(NULL);
if ( !komodo_dailysnapshot(pindexNew->GetHeight()) )

4
src/wallet/rpcwallet.cpp

@ -8047,10 +8047,10 @@ UniValue opreturn_burn(const UniValue& params, bool fHelp)
throw runtime_error("not enough normals\n");
CScript opret; uint8_t *ptr;
opret << OP_RETURN;
opret << OP_RETURN << 0;
int32_t len = strlen(strHex.c_str());
len >>=1;
opret.resize(len+1);
opret.resize(len+2);
ptr = (uint8_t *)&opret[1];
decode_hex(ptr,len,(char *)strHex.c_str());
mtx.vout.push_back(CTxOut(nAmount,opret));

Loading…
Cancel
Save