WhiteflagProtocol / whiteflag-api

Reference implementation of the Whiteflag protocol in Node.js that acts as an API to connect applications with the underlying blockchains
https://api.whiteflagprotocol.org
Other
4 stars 5 forks source link

Handle unmined transactions #25

Open ts5746 opened 2 years ago

ts5746 commented 2 years ago

Currently, the Bitcoin module does not take action if a transaction is not mined into a block. This may result in undesired effects, such as the input UTXOs marked as spent forever and the transaction not being confirmed.

The Bitcoin module can recognize this, e.g. by checking that the transceive direction of the message is "TX" instead of "RX" after seeing it in a block, and/or by noticing that the UTXOs do not show the hash of the transaction in which they were to be spent.

Th Ethereum module checks for this by waiting for a "receipt" when sending the transaction, which is feasible because of the significantly short block time. Nevertheless, this might be reviewed as well to ensure this situation is handled in a consistent manner for all blockchains.