2021-05-3 - Breaking API and behaviour changes
 over 4 years ago by Richard Holland
Hooks testnet build 0a1cb3f175414a5a7bb1b6b4c4646c04
API Changes
- emitnow takes a- write_ptrand- write_lenparameter pair at the start of the paramaters. This must be at least 32 bytes and will be populated with the canonical hash of the emitted transaction.
- hookand- cbaknow take a- uint32_tas the sole parameter. In- cbakthis is- 1when the emitted txn has failed to be accepted before- sfLastLedgerSeqwhen- 0the emitted txn was accepted.
Behaviour Changes
- Emitted transactions that are successfully passed to emitbut subsequently fail to be incorporated into a ledger beforesfLastLedgerSequenceexpires are now cleaned up by attEMIT_FAILUREpseudotransaction.
- ttEMIT_FAILUREalso triggers- cbak(1)on the emitting hook. Note the previously reserved parameter to callback is now used to signal that an emitted transaction failed.- 0= success- 1= failure.
- Maximum number of emitted transactions in a chain of emitted transactions (i.e. where one emitted txn emits another txn) is now 10.
- sfLastLedgerSeqfor emitted transactions must be 5 more than the current ledger.