This commit is contained in:
jl777
2018-12-29 04:24:00 -11:00
parent 27d672a972
commit 31129381b4

View File

@@ -282,10 +282,7 @@ UniValue selfimport(const UniValue& params, bool fHelp)
if ( GetTransaction(txid,burnTx,blockHash,false) == 0 ) if ( GetTransaction(txid,burnTx,blockHash,false) == 0 )
throw runtime_error("selfimport couldnt find txid"); throw runtime_error("selfimport couldnt find txid");
savevout = burnTx.vout[0]; savevout = burnTx.vout[0];
mtx.vout.resize(2); vouts = burnTx.vout;
mtx.vout[1] = savevout;
mtx.vout[1].nValue = burnAmount;
vouts = mtx.vout;
burnOut = MakeBurnOutput(burnAmount,0xffffffff,ASSETCHAINS_SELFIMPORT,vouts); burnOut = MakeBurnOutput(burnAmount,0xffffffff,ASSETCHAINS_SELFIMPORT,vouts);
mtx = burnTx; mtx = burnTx;
mtx.vout.clear(); mtx.vout.clear();
@@ -293,10 +290,11 @@ UniValue selfimport(const UniValue& params, bool fHelp)
burnTx = mtx; burnTx = mtx;
if ( GetSelfimportProof(proof,burnTx,burnTx.GetHash()) < 0 ) if ( GetSelfimportProof(proof,burnTx,burnTx.GetHash()) < 0 )
throw std::runtime_error("Failed validating selfimport"); throw std::runtime_error("Failed validating selfimport");
mtx.clear();
mtx = MakeImportCoinTransaction(proof,burnTx,vouts); mtx = MakeImportCoinTransaction(proof,burnTx,vouts);
mtx.vout.resize(2); //mtx.vout.resize(2);
mtx.vout[1] = savevout; //mtx.vout[1] = savevout;
mtx.vout[1].nValue = burnAmount; //mtx.vout[1].nValue = burnAmount;
return HexStr(E_MARSHAL(ss << mtx)); return HexStr(E_MARSHAL(ss << mtx));
} }