-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
We currently have AddressBalance in dash-spv and WalletBalance in key-wallet. They differ slightly with the SPV one considering instant locks. We should probably have a single balance structure in the wallet which covers everything and gets used from the SPV client.
rust-dashcore/dash-spv/src/types.rs
Lines 570 to 583 in b181584
| #[derive(Debug, Clone, PartialEq, Eq)] | |
| pub struct AddressBalance { | |
| /// Confirmed balance (6+ confirmations or InstantLocked). | |
| pub confirmed: dashcore::Amount, | |
| /// Unconfirmed balance (less than 6 confirmations). | |
| pub unconfirmed: dashcore::Amount, | |
| /// Pending balance from mempool transactions (not InstantLocked). | |
| pub pending: dashcore::Amount, | |
| /// Pending balance from InstantLocked mempool transactions. | |
| pub pending_instant: dashcore::Amount, | |
| } |
rust-dashcore/key-wallet/src/wallet/balance.rs
Lines 11 to 19 in bad5230
| #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | |
| pub struct WalletBalance { | |
| /// Confirmed and mature balance (UTXOs with enough confirmations to be spendable) | |
| spendable: u64, | |
| /// Unconfirmed balance (UTXOs without confirmations) | |
| unconfirmed: u64, | |
| /// Locked balance (UTXOs reserved for specific purposes like CoinJoin) | |
| locked: u64, | |
| } |
Metadata
Metadata
Assignees
Labels
No labels