From b919700d633e3b2e4a629f1a4135e549ee75e879 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 29 Dec 2018 03:54:58 -1100 Subject: [PATCH] Fix burn --- src/rpc/crosschain.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rpc/crosschain.cpp b/src/rpc/crosschain.cpp index 7f7f43452..a016a5909 100644 --- a/src/rpc/crosschain.cpp +++ b/src/rpc/crosschain.cpp @@ -281,12 +281,16 @@ UniValue selfimport(const UniValue& params, bool fHelp) if ( GetTransaction(txid,burnTx,blockHash,false) == 0 ) throw runtime_error("selfimport couldnt find txid"); + burnOut = MakeBurnOutput(burnAmount,0xffffffff,ASSETCHAINS_SELFIMPORT,burnTx.vout); savevout = burnTx.vout[0]; mtx = burnTx; - mtx.vin.clear(); + mtx.vout.clear(); + mtx.vout.push_back(burnOut); burnTx = mtx; - if ( GetSelfimportProof(proof,burnTx,txid) < 0 ) + if ( GetSelfimportProof(proof,burnTx,burnTx.GetHash()) < 0 ) throw std::runtime_error("Failed validating selfimport"); + if ( GetTransaction(txid,burnTx,blockHash,false) == 0 ) + throw runtime_error("selfimport couldnt find txid"); burnOut = MakeBurnOutput(burnAmount,0xffffffff,ASSETCHAINS_SELFIMPORT,burnTx.vout); mtx = MakeImportCoinTransaction(proof,burnTx,burnTx.vout); mtx.vout[1] = savevout;