Skip to content

Commit

Permalink
make ibc_core_checker's logic more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
justfortest2 committed Jun 11, 2020
1 parent ade61f4 commit 504d5a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions plugins/ibc_plugin/ibc_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@ namespace eosio { namespace ibc {
par.memo = "memo";
actions.push_back(par);
} else {
continue;
elog("internal error, failed to get transfer action infomation from packed_trx_receipt");
break;
}
Expand Down Expand Up @@ -4034,6 +4035,8 @@ namespace eosio { namespace ibc {
} else { ilog("internal error, failed to get cash transaction information of seq_num ${n}",("n",range.second)); }
}

bool force_forward = false;

if ( ! orig_trxs_to_push.empty() ){
std::vector<ibc_trx_rich_info> to_push;
if ( orig_trxs_to_push.size() > max_push_orig_trxs_per_time ){
Expand All @@ -4056,6 +4059,8 @@ namespace eosio { namespace ibc {
try {
token_contract->push_cash_trxs( to_push, range.second + 1 );
} FC_LOG_AND_DROP()
} else {
force_forward = true;
}
}

Expand Down Expand Up @@ -4105,7 +4110,7 @@ namespace eosio { namespace ibc {
bool orig_b = false, cash_b = false;

// --- check local_origtrxs ---
if ( orig_trxs_to_push.empty() || orig_trxs_to_push.back().trx_id == token_contract->last_origtrx_pushed ){
if ( orig_trxs_to_push.empty() || orig_trxs_to_push.back().trx_id == token_contract->last_origtrx_pushed || force_forward ){
orig_b = true;
}

Expand All @@ -4125,7 +4130,7 @@ namespace eosio { namespace ibc {

// --- summary ---
if ( ! (reached_min_length && orig_b && cash_b ) ){
idump((reached_min_length)(orig_b)(cash_b));
idump((reached_min_length)(orig_b)(cash_b)(force_forward));
return;
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/eosio_build_darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@
printf "\\n\\tChecking clang in CommandLineTools for MacOS.\\n"
which clang | grep CommandLineTools 1> /dev/null
ISCMDCLANG=$?
if [ ${ISCMDCLANG} -ne 0 ]; then
# if [ ${ISCMDCLANG} -ne 0 ]; then
# printf "\\tPlease use the Apple clang version 11.0.0 at least.\\n"
# printf "\\tIf installed, please change the PATH to use it\\n"
# printf "\\tOr download v11.3.1 from: https://developer.apple.com/download/more/. \\n"
# printf "\\tExiting now.\\n\\n"
# exit 1;
fi
# fi

printf "\\n\\tChecking boost library installation.\\n"
BVERSION=$( grep "#define BOOST_VERSION" "/usr/local/include/boost/version.hpp" 2>/dev/null | tail -1 | tr -s ' ' | cut -d\ -f3 )
Expand Down

0 comments on commit 504d5a9

Please sign in to comment.