Skip to content

Commit

Permalink
GH-986 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Nov 14, 2024
1 parent 6ed7b18 commit 19f4d6c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/exceptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ namespace eosio { namespace chain {
FC_DECLARE_DERIVED_EXCEPTION( interrupt_exception, resource_exhausted_exception,
3080011, "Transaction interrupted by signal" )
FC_DECLARE_DERIVED_EXCEPTION( interrupt_oc_exception, resource_exhausted_exception,
3080012, "Transaction interrupted oc compile" )
3080012, "Transaction interrupted by oc compile" )

FC_DECLARE_DERIVED_EXCEPTION( authorization_exception, chain_exception,
3090000, "Authorization exception" )
Expand Down
2 changes: 2 additions & 0 deletions libraries/chain/include/eosio/chain/transaction_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ namespace eosio::chain {

class transaction_context {
private:
// construction/reset initialization
void initialize();
void reset();
// common init called by init_for_* methods below
void init( uint64_t initial_net_usage);

public:
Expand Down
5 changes: 2 additions & 3 deletions libraries/chain/include/eosio/chain/wasm_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

namespace eosio { namespace chain {

struct platform_timer;

class apply_context;
struct platform_timer;
class apply_context;
class wasm_runtime_interface;
class controller;
namespace eosvmoc { struct config; }
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/transaction_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ namespace eosio::chain {
void transaction_context::exec() {
EOS_ASSERT( is_initialized, transaction_exception, "must first initialize" );

while (true) {
for (int i = 0; i < 2; ++i) { // interrupt_oc_exception can only happen once
try {
const transaction& trx = packed_trx.get_transaction();
if( apply_context_free ) {
Expand All @@ -365,7 +365,7 @@ namespace eosio::chain {

break;
} catch ( const fc::exception& e ) {
if (e.code() == interrupt_oc_exception::code_value) {
if (i == 0 && e.code() == interrupt_oc_exception::code_value) {
reset();
continue;
}
Expand Down

0 comments on commit 19f4d6c

Please sign in to comment.