remove_timer

remove_timer | code​

1
/**
2
* LiquidScheduler uses the remove_timer macro to remove a timer from the timerentry singleton
3
*
4
* @param {name} timer - account name to scope the timer within
5
* @param {std::vector<char>} payload - payload to be accessed within the timer_callback function in the consumer contract
6
* @param {uint32_t} seconds - seconds to repeat the cron
7
*
8
* Example:
9
*
10
* @code
11
* [[eosio::action]] void testsremove() {
12
* std::vector<char> payload;
13
* remove_timer(_self, payload, 2);
14
* }
15
* @endcode
16
*/
17
​
18
static void remove_timer(name timer,std::vector<char> payload, uint32_t seconds){ \
19
timers_def timers(current_receiver(), timer.value); \
20
if(timers.exists()){ \
21
timers.remove(); \
22
} \
23
} \
Copied!
Copy link