0

Is it 100% sure that deferred transaction will run on what delay is defined? Is there any possibility that deferred transaction failed to run on defined day? If it fails what is the alternative?

mainloan::checkPayment(uint64_t loan_id) { require_auth(_self);

auto itr = loan_table.find(loan_id);
eosio::transaction t {};
t.action.emplace_back(
    permission_level(_selfse,"active"_n)),
    _self,
    "calIpd"_n **//fuction to be called after every 24hours.**
    std::make_tuple(itr);
    t.delay_sec=1; **//what delay should i give for 24 hour (1day)**
    t.send(now(),_self);
    eosio::print("transaction sent.");

}

what delay should i define so that my function runs after every 24 hour ?

0

1>>yes deferred transaction can be failed its possible and its not 100% guaranteed to work.

2>>i could not find the alternative of deferred transaction but i have found one solution and that is by maintaining a table. maintain a table everytime your function run i.e. maintain the date ad time whenever tranasction happens.and suppose if transaction is pending then push the pending transaction 1st and then it will work normally.

3>>and delay for 24 hour should be equal to no.of seconds present in 24 hour

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.