set expiryHeight to 0 for Import TXs
This commit is contained in:
@@ -13,9 +13,10 @@ int32_t komodo_nextheight();
|
|||||||
|
|
||||||
CTransaction MakeImportCoinTransaction(const TxProof proof, const CTransaction burnTx, const std::vector<CTxOut> payouts)
|
CTransaction MakeImportCoinTransaction(const TxProof proof, const CTransaction burnTx, const std::vector<CTxOut> payouts)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::vector<uint8_t> payload = E_MARSHAL(ss << EVAL_IMPORTCOIN);
|
std::vector<uint8_t> payload = E_MARSHAL(ss << EVAL_IMPORTCOIN);
|
||||||
CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight());
|
CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight());
|
||||||
|
if (mtx.fOverwintered)
|
||||||
|
mtx.nExpiryHeight = 0;
|
||||||
mtx.vin.push_back(CTxIn(COutPoint(burnTx.GetHash(), 10e8), CScript() << payload));
|
mtx.vin.push_back(CTxIn(COutPoint(burnTx.GetHash(), 10e8), CScript() << payload));
|
||||||
mtx.vout = payouts;
|
mtx.vout = payouts;
|
||||||
auto importData = E_MARSHAL(ss << proof; ss << burnTx);
|
auto importData = E_MARSHAL(ss << proof; ss << burnTx);
|
||||||
@@ -23,7 +24,6 @@ CTransaction MakeImportCoinTransaction(const TxProof proof, const CTransaction b
|
|||||||
return CTransaction(mtx);
|
return CTransaction(mtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CTxOut MakeBurnOutput(CAmount value, uint32_t targetCCid, std::string targetSymbol, const std::vector<CTxOut> payouts)
|
CTxOut MakeBurnOutput(CAmount value, uint32_t targetCCid, std::string targetSymbol, const std::vector<CTxOut> payouts)
|
||||||
{
|
{
|
||||||
std::vector<uint8_t> opret = E_MARSHAL(ss << VARINT(targetCCid);
|
std::vector<uint8_t> opret = E_MARSHAL(ss << VARINT(targetCCid);
|
||||||
|
|||||||
18
src/main.cpp
18
src/main.cpp
@@ -1489,24 +1489,6 @@ bool CheckTransactionWithoutProofVerification(uint32_t tiptime,const CTransactio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ASSETCHAINS_TXPOW != 0 && tx.vjoinsplit.size() == 0 )
|
|
||||||
{
|
|
||||||
// genesis coinbase 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
|
|
||||||
uint256 txid = tx.GetHash();
|
|
||||||
if ( ((ASSETCHAINS_TXPOW & 2) != 0 && iscoinbase != 0) || ((ASSETCHAINS_TXPOW & 1) != 0 && iscoinbase == 0) )
|
|
||||||
{
|
|
||||||
if ( ((uint8_t *)&txid)[0] != 0 || ((uint8_t *)&txid)[31] != 0 )
|
|
||||||
{
|
|
||||||
uint256 genesistxid = uint256S("4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b");
|
|
||||||
if ( txid != genesistxid )
|
|
||||||
{
|
|
||||||
fprintf(stderr,"private chain iscoinbase.%d invalid txpow.%d txid.%s\n",iscoinbase,ASSETCHAINS_TXPOW,txid.GetHex().c_str());
|
|
||||||
return state.DoS(100, error("CheckTransaction(): this is a txpow chain, must have 0x00 ends"),REJECT_INVALID, "bad-txns-actxpow-chain");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure input values do not exceed MAX_MONEY
|
// Ensure input values do not exceed MAX_MONEY
|
||||||
// We have not resolved the txin values at this stage,
|
// We have not resolved the txin values at this stage,
|
||||||
// but we do know what the joinsplits claim to add
|
// but we do know what the joinsplits claim to add
|
||||||
|
|||||||
Reference in New Issue
Block a user