Skip to content

Commit 3c57806

Browse files
committed
workaround for crashing explorer_node.
1 parent 55117c1 commit 3c57806

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

node/processor.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5615,13 +5615,21 @@ int NodeProcessor::get_AssetAt(Asset::Full& ai, Height h)
56155615
{
56165616
if (m_Target == m_nKrnIdx)
56175617
{
5618-
if (TxKernel::Subtype::AssetCreate != krn_.get_Subtype())
5619-
OnCorrupted();
5620-
const TxKernelAssetCreate& krn = Cast::Up<TxKernelAssetCreate>(krn_);
5618+
if (TxKernel::Subtype::AssetCreate == krn_.get_Subtype())
5619+
{
5620+
const TxKernelAssetCreate& krn = Cast::Up<TxKernelAssetCreate>(krn_);
56215621

5622-
m_pDst->m_Owner = krn.m_Owner;
5623-
m_pDst->m_Metadata.m_Value.swap(Cast::NotConst(krn.m_MetaData.m_Value));
5624-
m_pDst->m_Metadata.m_Hash = krn.m_MetaData.m_Hash;
5622+
m_pDst->m_Owner = krn.m_Owner;
5623+
m_pDst->m_Metadata.m_Value.swap(Cast::NotConst(krn.m_MetaData.m_Value));
5624+
m_pDst->m_Metadata.m_Hash = krn.m_MetaData.m_Hash;
5625+
}
5626+
else
5627+
{
5628+
// Was created by the contract. This is a workaround
5629+
m_pDst->m_Owner = Zero;
5630+
m_pDst->m_Metadata.m_Value.clear();
5631+
m_pDst->m_Metadata.m_Hash = Zero;
5632+
}
56255633
}
56265634
return true;
56275635
}

0 commit comments

Comments
 (0)