0

I have Enough CPU and NET i have staked 13 EOS for each and still unable to run the code. Please suggest if i can improve anything. IS there any problem of table index

Got this from developer.io if anyone can explain what is this indexed_by<"byage"_n, const_mem_fun> do and is there any mistake related to this in my code coz i have not added this

typedef eosio::multi_index<"people"_n, person, 
indexed_by<"byage"_n, const_mem_fun<person, uint64_t, &person
::get_secondary_1>>
  > address_index;
typedef eosio::multi_index<"paymentmade"_n,payment_made>paymentmade;    
paymentmade payMade_table;



void mainloan::payconfirm(double pay_amunt,name from ,uint64_t loan_id)
{
  require_auth(_self);
  auto loan = loan_table.find(loan_id);
  auto pay_date = current_time_point();

  paymade_table.emplace(get_self(),[&](auto &p){
  p.pay_id=paymade_table.available_primary_key();
  p.pay_date=pay_date;
  p.pay_amunt=pay_amunt;
  p.pay_from=from;
  p.loan_id=loan_id;
}); 
loan_table.modify(loan, _self,[&](auto& l){
  l.last_pay_date = pay_date;
  l.lending_amount=loan->lending_amount-pay_amunt; 
});
}

5
  • Are you running this on your local computer? If so the issue is probably that your CPU is too slow Sep 6, 2019 at 13:31
  • yes, its local computer.Is there anything i can do to make it work ? Sep 6, 2019 at 13:33
  • 1
    Your code can't really be optimised much further, the problem is your computer isn't fast enough to run the code. Without buying a better computer, all you can do is make sure that you run as few processes alongside nodeos as possible Sep 7, 2019 at 14:58
  • 1
    It doesn't look like you're doing anything fancy, what is your max-transaction-time set at in your config.ini file for your nodeos instance? You may be able to resolve the issue by upping it.
    – Nat
    Sep 9, 2019 at 0:37
  • EOSIO testnet can be ran locally on a potato. Increase max transaction time as suggested. Sep 9, 2019 at 3:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.