Appearance
etxn_generation
Summary. Return the emit-generation counter that a transaction emitted now would carry.
Signature.
c
int64_t etxn_generation();Parameters. None.
Return value. The generation an emitted transaction will have, equal to otxn_generation() + 1. It does not return an error (implemented as a proxy-only call).
Common failure patterns. None — it is a pure accessor.
Caveats / notes.
- A user-submitted transaction is generation
0, so the first emission is generation1. emitrejects any emitted transaction whose generation is10or greater; this is the hard depth limit that stops runaway emission chains.etxn_detailswrites this value intosfEmitGenerationfor you.
Minimal example.
c
int64_t gen = etxn_generation(); // e.g. 1 for a top-level hook's emissionPractical example.
c
// The generation an emission will carry is always one more than the
// originating transaction's generation.
ASSERT(otxn_generation() + 1 == etxn_generation());Related APIs. otxn_generation, etxn_burden, etxn_details.