nerdcash / Nerdbank.Cryptocurrencies

.NET libraries for processing Zcash and other cryptocurrencies.
MIT License
5 stars 3 forks source link

Account recovery tends to record transparent transactions without mined height #283

Closed AArnott closed 5 months ago

AArnott commented 5 months ago

The report_new_transactions rust function will report transparent transactions as soon as they've been downloaded, which may be before the compact blocks that contains it has been scanned. In such cases, the v_transactions view doesn't yet have the mined_height recorded for the transaction. Although the transaction eventually gets a mined_height filled in after scanning the compact block, we don't report the transaction as new any more, leaving the C# side without a notification that the transaction has a mined height.

We should fix this to either hold reporting downloaded transactions to when we have their mined height (with consideration for mempool transaction reporting) or we should report the downloaded transactions again when their mined height has been set.

I'm thinking we should go for the latter option, since the client should always be prepared to receive the mined height for a given transaction multiple times in cases of re-orgs.