mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix logging transactions that throw
This commit is contained in:
@@ -217,6 +217,15 @@ public:
|
||||
return v.mData != mData;
|
||||
}
|
||||
|
||||
std::string getHex () const
|
||||
{
|
||||
std::stringstream h;
|
||||
h << std::hex << std::setfill ('0');
|
||||
for (unsigned char const& element : mData)
|
||||
h << std::setw (2) << element;
|
||||
return h.str ();
|
||||
}
|
||||
|
||||
// low-level VL length encode/decode functions
|
||||
static Blob encodeVL (int length);
|
||||
static int lengthVL (int length)
|
||||
|
||||
@@ -1502,13 +1502,13 @@ private:
|
||||
|
||||
void recvTransaction (protocol::TMTransaction& packet)
|
||||
{
|
||||
Transaction::pointer tx;
|
||||
|
||||
Serializer s (packet.rawtransaction ());
|
||||
|
||||
#ifndef TRUST_NETWORK
|
||||
try
|
||||
{
|
||||
#endif
|
||||
Serializer s (packet.rawtransaction ());
|
||||
SerializerIterator sit (s);
|
||||
SerializedTransaction::pointer stx = boost::make_shared<SerializedTransaction> (boost::ref (sit));
|
||||
uint256 txID = stx->getTransactionID();
|
||||
@@ -1548,13 +1548,8 @@ private:
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
#ifdef BEAST_DEBUG
|
||||
Log::out() << "Transaction from peer fails validity tests";
|
||||
Json::StyledStreamWriter w;
|
||||
// VFALCO NOTE This bypasses the Log bottleneck
|
||||
w.write (std::cerr, tx->getJson (0));
|
||||
#endif
|
||||
return;
|
||||
m_journal.warning << "Transaction invalid: " <<
|
||||
s.getHex();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user