@@ -133,27 +133,38 @@ doLedgerGrpc(RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerRequest>& context)
133
133
134
134
if (request.transactions ())
135
135
{
136
- for ( auto & i : ledger-> txs )
136
+ try
137
137
{
138
- assert (i.first );
139
- if (request.expand ())
138
+ for (auto & i : ledger->txs )
140
139
{
141
- auto txn =
142
- response.mutable_transactions_list ()->add_transactions ();
143
- Serializer sTxn = i.first ->getSerializer ();
144
- txn->set_transaction_blob (sTxn .data (), sTxn .getLength ());
145
- if (i.second )
140
+ assert (i.first );
141
+ if (request.expand ())
146
142
{
147
- Serializer sMeta = i.second ->getSerializer ();
148
- txn->set_metadata_blob (sMeta .data (), sMeta .getLength ());
143
+ auto txn = response.mutable_transactions_list ()
144
+ ->add_transactions ();
145
+ Serializer sTxn = i.first ->getSerializer ();
146
+ txn->set_transaction_blob (sTxn .data (), sTxn .getLength ());
147
+ if (i.second )
148
+ {
149
+ Serializer sMeta = i.second ->getSerializer ();
150
+ txn->set_metadata_blob (sMeta .data (), sMeta .getLength ());
151
+ }
152
+ }
153
+ else
154
+ {
155
+ auto const & hash = i.first ->getTransactionID ();
156
+ response.mutable_hashes_list ()->add_hashes (
157
+ hash.data (), hash.size ());
149
158
}
150
159
}
151
- else
152
- {
153
- auto const & hash = i.first ->getTransactionID ();
154
- response.mutable_hashes_list ()->add_hashes (
155
- hash.data (), hash.size ());
156
- }
160
+ }
161
+ catch (std::exception const & e)
162
+ {
163
+ JLOG (context.j .error ())
164
+ << __func__ << " - Error deserializing transaction in ledger "
165
+ << ledger->info ().seq
166
+ << " . skipping transaction and following transactions. You "
167
+ " should look into this further" ;
157
168
}
158
169
}
159
170
0 commit comments