zcash / librustzcash

Rust-language assets for Zcash
Other
333 stars 249 forks source link

`zcash_client_*`: Fix bug where transparent funds can't be shielded before the normal confirmation depth #1413

Open str4d opened 3 months ago

str4d commented 3 months ago

We've had Zashi user reports that they can't shield funds after 1 confirmation as they expect, and instead have to wait for 10 confirmations (used for normal spending). The mobile SDKs don't allow shielding funds if there are insufficient funds to shield in the wallet balance.

str4d commented 3 months ago

I think I found the cause of the bug in zcash_client_sqlite here: https://github.com/zcash/librustzcash/pull/1257#discussion_r1637994605

https://github.com/zcash/librustzcash/blob/5a2a670ffca5d81e54c166d0f6b5cf5bcce84f32/zcash_client_sqlite/src/wallet.rs#L1299-L1305

The :max_height variable is set to zero_conf_height, but the latter is not actually zero-conf, it's the same as summary_height (except that it doesn't force min_confirmations to be at least 1).

str4d commented 2 months ago

I think we have fixed this; we should check.