🐗 WarthogDeFi DEVELOPMENT IX. 🏗️
Shifu, dev:
I am currently working on a cancelation mechanism that can be used to cancel existing orders and pending transactions.
❓ Can you elaborate on the cancellation system?
- Yes, the cancelation shall work in two ways:
📎 Firstly, it blocks other transactions with the same Id that were not yet included in a block, i.e. when the cancelation was included first, the transaction that it refers cannot be included afterwards and also not in the same block.
🖇️ Secondly, it shall work on orders. When an order (for the order book in DeFI) transaction is included in a block, it subtracts the spent amount from the balance of the order creator account. When the cancellation is included later, the order will be cleared from the order book if it is not completely filled yet and the remaining amount is credited back to the order creator account (which is the same as the cancel transaction creator account).
⚠️ A cancelation cannot guarantee that miners won't decide to include the pending transaction instead of the cancelation. It would be wise to use higher fee for the cancelation. ❗️