Page MenuHomePhabricator

[Cashtab] Ignore immature coinbase utxos in sendXec function
ClosedPublic

Authored by bytesofman on Jan 16 2024, 17:20.

Details

Summary

For Cashtab users with staking reward utxos in their wallet -- ignore unspendable staking reward utxos in

  1. The sendXec function
  2. The onMax function used to calculate the max sendable amount in a wallet
Test Plan

npm test

In a wallet with staking rewards, npm start, verify result of onMax on SendXec screen does not include recent staking rwds

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bytesofman published this revision for review.EditedJan 16 2024, 17:56

Still more work to be done for this feature to be considered complete. However, I believe it's worth landing this as-is while that work continues, since it will fix a bug.

The additional work will generally improve the app but require some refactors. Without it, there is an edge case where the user may receive an 'insufficient' funds error if they try to send less than their total balance but more than their spendable balance. I think this is acceptable behavior for say, a couple of days, in order to patch the issue of any staking rewards potentially rendering a wallet unusable.

  • Stop calculating the balances object and adding it to wallet state, this calc should be done in a new BalanceHeader component that handles the spendable / unspendable distinction
  • Refactor validation for amount field to show error if exceed spendable balance and not total balance
Fabien added a subscriber: Fabien.

This is incomplete for sure, but it's a strict improvement over the current situation so I have no problem with this

This revision is now accepted and ready to land.Jan 16 2024, 19:40