Check for -port

This commit is contained in:
jl777
2018-12-28 03:25:18 -11:00
parent 67f3678435
commit a3f0af586e
3 changed files with 44 additions and 15 deletions

View File

@@ -183,10 +183,11 @@ UniValue migrate_converttoexport(const UniValue& params, bool fHelp)
}
if ( ASSETCHAINS_SELFIMPORT.size() > 0 )
{
if ( ASSETCHAINS_SELFIMPORT == targetSymbol || ASSETCHAINS_SELFIMPORT == "GATEWAY" )
throw runtime_error("self-import chains cant be fungible");
/*if ( ASSETCHAINS_SELFIMPORT == targetSymbol || ASSETCHAINS_SELFIMPORT == "GATEWAY" )
{
ccid = 0xffffffff;
} // else maybe clusters of self-import chains can be supported?
} // else maybe clusters of self-import chains can be supported?*/
}
CTxOut burnOut = MakeBurnOutput(burnAmount, ccid, targetSymbol, tx.vout);
UniValue ret(UniValue::VOBJ);
@@ -262,6 +263,29 @@ UniValue migrate_completeimporttransaction(const UniValue& params, bool fHelp)
return HexStr(E_MARSHAL(ss << importTx));
}
#ifdef selfimport
UniValue selfimport(const UniValue& params, bool fHelp)
{
TxProof proof; CTransaction importTx,burnTx; CTxOut burnOut; uint64_t burnAmount; uint256 blockHash;
if ( ASSETCHAINS_SELFIMPORT.size() == 0 )
throw runtime_error("selfimport only works on -ac_import chains");
if (fHelp || params.size() != 2)
throw runtime_error("selfimport txid burnamount\n\n"
"creates signed selfimport transaction from txid");
//txid =
//burnAmount =
if ( GetTransaction(txid,burnTx,hashBlock,false) == 0 )
throw runtime_error("selfimport couldnt find txid");
if ( GetSelfimportProof(proof,burnTx,txid) < 0 )
throw std::runtime_error("Failed validating selfimport");
burnOut = MakeBurnOutput(burnAmount,0xffffffff,ASSETCHAINS_SELFIMPORT,burnTx.vout);
importTx = MakeImportCoinTransaction(proof,burnTx,payouts);
importTx.vout.clear();
importTx.vout.push_back(burnOut);
}
#endif
UniValue getNotarisationsForBlock(const UniValue& params, bool fHelp)
{