-
Notifications
You must be signed in to change notification settings - Fork 59
fix(platform-wallet): give an unconfirmed outgoing send an owner across a restart #4659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4.2-dev
Are you sure you want to change the base?
Changes from 5 commits
f388aab
a926bde
4d15fbe
c181c0c
0faf637
6696093
02d8e0d
c383d0d
9ae3ec8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -573,6 +573,21 @@ pub struct ProviderSpecialTxRestoreEntryFFI { | |
| pub first_seen: u64, | ||
| } | ||
|
|
||
| /// One outgoing transaction the host still holds as unconfirmed, | ||
| /// replayed at load so its spend effect survives a restart. | ||
| #[repr(C)] | ||
| pub struct UnconfirmedOutgoingTxRecordFFI { | ||
| /// Consensus-encoded transaction body, the same wire format | ||
| /// `dashcore::consensus::encode::serialize` produces. Swift-owned | ||
| /// for the callback window; freed by `LoadWalletListFreeFn`. | ||
| pub tx_bytes: *mut u8, | ||
| pub tx_bytes_len: usize, | ||
| /// Host's `firstSeen` for the row, in seconds. The load path | ||
| /// replays in ascending order so a parent send is applied before a | ||
| /// child that spends its change. | ||
| pub first_seen: u64, | ||
| } | ||
|
|
||
| /// Per-wallet entry returned by `on_load_wallet_list_fn`. | ||
| /// | ||
| /// `accounts` points to a contiguous array of length `accounts_count`. | ||
|
|
@@ -644,6 +659,16 @@ pub struct WalletRestoreEntryFFI { | |
| /// unresolved asset locks. | ||
| pub unresolved_asset_lock_tx_records: *const UnresolvedAssetLockTxRecordFFI, | ||
| pub unresolved_asset_lock_tx_records_count: usize, | ||
| /// Outgoing transactions the host still holds as unconfirmed | ||
| /// (mempool context, no block height), oldest `first_seen` first. | ||
| /// | ||
| /// Replayed at load through the ordinary mempool check so their | ||
| /// spend effect is restored — see | ||
| /// [`UnconfirmedOutgoingTxRecordFFI`]. `null` / `0` when the wallet | ||
| /// has none. Each entry's `tx_bytes` buffer is Swift-owned and | ||
| /// freed by `LoadWalletListFreeFn`. | ||
| pub unconfirmed_outgoing_tx_records: *const UnconfirmedOutgoingTxRecordFFI, | ||
| pub unconfirmed_outgoing_tx_records_count: usize, | ||
|
Comment on lines
+678
to
+679
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: Preserve the wallet restore FFI layout or version the ABI
source: |
||
| /// Persisted provider special transactions (ProRegTx / ProUpServTx / | ||
| /// ProUpRegTx / ProUpRevTx) re-staged onto the wallet's provider-key | ||
| /// accounts so rust-dashcore #876 retention keeps them resident and | ||
|
|
@@ -702,6 +727,8 @@ impl Default for WalletRestoreEntryFFI { | |
| tracked_asset_locks_count: 0, | ||
| unresolved_asset_lock_tx_records: std::ptr::null(), | ||
| unresolved_asset_lock_tx_records_count: 0, | ||
| unconfirmed_outgoing_tx_records: std::ptr::null(), | ||
| unconfirmed_outgoing_tx_records_count: 0, | ||
| provider_special_txs: std::ptr::null(), | ||
| provider_special_txs_count: 0, | ||
| core_address_pools: std::ptr::null(), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.