diff --git a/Cargo.lock b/Cargo.lock index 2234e3cabf1..60fa62c7549 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "dash-network" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "bincode", "bincode_derive", @@ -1579,7 +1579,7 @@ dependencies = [ [[package]] name = "dash-network-seeds" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "dash-network", ] @@ -1656,7 +1656,7 @@ dependencies = [ [[package]] name = "dash-spv" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "async-trait", "chrono", @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "dash-spv-ffi" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "cbindgen 0.29.2", "clap", @@ -1703,7 +1703,7 @@ dependencies = [ [[package]] name = "dashcore" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "anyhow", "base64-compat", @@ -1729,12 +1729,12 @@ dependencies = [ [[package]] name = "dashcore-private" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" [[package]] name = "dashcore-rpc" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "dashcore-rpc-json", "hex", @@ -1747,7 +1747,7 @@ dependencies = [ [[package]] name = "dashcore-rpc-json" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "bincode", "dashcore", @@ -1762,7 +1762,7 @@ dependencies = [ [[package]] name = "dashcore_hashes" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "bincode", "dashcore-private", @@ -3811,7 +3811,7 @@ dependencies = [ [[package]] name = "key-wallet" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "aes", "async-trait", @@ -3839,7 +3839,7 @@ dependencies = [ [[package]] name = "key-wallet-ffi" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "cbindgen 0.29.2", "dash-network", @@ -3855,7 +3855,7 @@ dependencies = [ [[package]] name = "key-wallet-manager" version = "0.42.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=8fe9ea394306e5f9282505b24d09092ab9a33738#8fe9ea394306e5f9282505b24d09092ab9a33738" +source = "git+https://github.com/dashpay/rust-dashcore?rev=ca507a92967ab4ab60dd681de1f736f8cc1d129f#ca507a92967ab4ab60dd681de1f736f8cc1d129f" dependencies = [ "async-trait", "bincode", diff --git a/Cargo.toml b/Cargo.toml index 7b7bd609640..0912c5d5b31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,15 +49,15 @@ members = [ ] [workspace.dependencies] -dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } -dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } -dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } -dash-spv-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } -key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } -key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } -key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } -dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "8fe9ea394306e5f9282505b24d09092ab9a33738" } +dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } +dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } +dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } +dash-spv-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } +key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } +key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } +key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } +dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "ca507a92967ab4ab60dd681de1f736f8cc1d129f" } # Optimize heavy crypto crates even in dev/test builds so that # Halo 2 proof generation and verification run at near-release speed. diff --git a/packages/rs-platform-wallet/src/changeset/core_bridge.rs b/packages/rs-platform-wallet/src/changeset/core_bridge.rs index fba846eb155..829f69e4ea1 100644 --- a/packages/rs-platform-wallet/src/changeset/core_bridge.rs +++ b/packages/rs-platform-wallet/src/changeset/core_bridge.rs @@ -214,6 +214,9 @@ fn derive_new_utxos(record: &TransactionRecord) -> Vec { ); let is_instant = matches!(record.context, TransactionContext::InstantSend(_)); let is_coinbase = record.transaction.is_coin_base(); + // We own at least one input iff the wallet recorded any input details + // (those entries are keyed to inputs that spent our outpoints). + let owns_any_input = !record.input_details.is_empty(); record .output_details @@ -228,6 +231,9 @@ fn derive_new_utxos(record: &TransactionRecord) -> Vec { .get(detail.index as usize)? .clone(); let address = detail.address.clone()?; + // Mirror key-wallet's "trusted change" rule: change output of a + // transaction we authored (so it's our funds returning). + let is_trusted = matches!(detail.role, OutputRole::Change) && owns_any_input; Some(Utxo { outpoint: OutPoint { txid: record.txid, @@ -240,6 +246,7 @@ fn derive_new_utxos(record: &TransactionRecord) -> Vec { is_confirmed, is_instantlocked: is_instant, is_locked: false, + is_trusted, }) }) .collect() @@ -275,6 +282,7 @@ fn derive_spent_utxos(record: &TransactionRecord) -> Vec { is_confirmed: false, is_instantlocked: false, is_locked: false, + is_trusted: false, }) }) .collect()