I have added the problem statement as a comment in code so please read the commented line in code.

void mainloan::checkdaily(uint64_t loan_id)
  auto itr = loan_table.find(loan_id);
  auto borrower = itr->borr_name;

  eosio::transaction t;
      permission_level(_self, "active"_n),
      "calipd"_n, //fuction for calculating interest per day on principle amount
  t.delay_sec = 20; 
  t.send(now(), _self);
//deferred transaction end here

  eosio::print("loan Id:  ",itr->loan_id);//for debug only
  eosio::print("transaction sent.");

// I have try to store current date and loan_id into a table
//Most imp. part is my deferred transaction was running till i gave Loan_id to the table.

  defer_table.emplace(get_self(), [&](auto &df) {
    df.df_id = defer_table.available_primary_key();
    df.transaction_date = current_time_point_sec();


After adding the loan_id to the table i'm getting error on running this action.

Error: assertion failure with message: read

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.