fix source chain display error

This commit is contained in:
blackjok3r
2019-01-04 14:35:34 +08:00
parent 542607e4e2
commit 75ae32c0aa
2 changed files with 4 additions and 24 deletions

View File

@@ -453,22 +453,12 @@ UniValue getimports(const UniValue& params, bool fHelp)
objBurnTx.push_back(Pair("amount", ValueFromAmount(burnTx.vout.back().nValue)));
// extract op_return to get burn source chain.
std::vector<uint8_t> burnOpret; std::string targetSymbol; uint32_t targetCCid; uint256 payoutsHash; std::vector<uint8_t>rawproof;
GetOpReturnData(burnTx.vout.back().scriptPubKey, burnOpret);
if (E_UNMARSHAL(burnOpret, ss >> VARINT(targetCCid);
ss >> targetSymbol;
ss >> payoutsHash;
ss >> rawproof));
if (UnmarshalBurnTx(burnTx, targetSymbol, &targetCCid, payoutsHash, rawproof))
{
if (rawproof.size() > 0)
{
char *buffer; int32_t n;
buffer = (char*) malloc (65);
if (buffer!=NULL)
{
for (n=0; n<65; n++)
buffer[n]=rawproof[n];
objBurnTx.push_back(Pair("source", buffer));
}
std::string sourceSymbol(rawproof.begin(), rawproof.end());
objBurnTx.push_back(Pair("source", sourceSymbol));
}
}
}