diff --git a/sn_client/src/audit/dag_crawling.rs b/sn_client/src/audit/dag_crawling.rs index 2a3dd6b7f4..be3881248c 100644 --- a/sn_client/src/audit/dag_crawling.rs +++ b/sn_client/src/audit/dag_crawling.rs @@ -11,8 +11,8 @@ use crate::{Client, Error, SpendDag}; use futures::{future::join_all, StreamExt}; use sn_networking::{GetRecordError, NetworkError}; use sn_transfers::{ - SignedSpend, SpendAddress, SpendReason, WalletError, WalletResult, GENESIS_SPEND_UNIQUE_KEY, - NETWORK_ROYALTIES_PK, + SignedSpend, SpendAddress, SpendReason, WalletError, WalletResult, + DEFAULT_NETWORK_ROYALTIES_PK, GENESIS_SPEND_UNIQUE_KEY, NETWORK_ROYALTIES_PK, }; use std::collections::BTreeSet; use tokio::sync::mpsc::Sender; @@ -517,6 +517,12 @@ fn beta_track_analyze_spend(spend: &SignedSpend) -> BTreeSet { .iter() .map(|derivation_idx| NETWORK_ROYALTIES_PK.new_unique_pubkey(derivation_idx)) .collect(); + let default_royalty_pubkeys: BTreeSet<_> = spend + .spend + .network_royalties + .iter() + .map(|derivation_idx| DEFAULT_NETWORK_ROYALTIES_PK.new_unique_pubkey(derivation_idx)) + .collect(); let new_utxos: BTreeSet<_> = spend .spend @@ -524,6 +530,9 @@ fn beta_track_analyze_spend(spend: &SignedSpend) -> BTreeSet { .outputs .iter() .filter_map(|output| { + if default_royalty_pubkeys.contains(&output.unique_pubkey) { + return None; + } if !royalty_pubkeys.contains(&output.unique_pubkey) { Some(SpendAddress::from_unique_pubkey(&output.unique_pubkey)) } else { diff --git a/sn_transfers/src/lib.rs b/sn_transfers/src/lib.rs index 2224b0e1c4..fc7f232762 100644 --- a/sn_transfers/src/lib.rs +++ b/sn_transfers/src/lib.rs @@ -98,6 +98,12 @@ lazy_static! { Err(err) => panic!("Failed to parse network royalties PK: {err:?}"), } }; + pub static ref DEFAULT_NETWORK_ROYALTIES_PK: MainPubkey = { + match MainPubkey::from_hex(&DEFAULT_NETWORK_ROYALTIES_STR) { + Ok(pk) => pk, + Err(err) => panic!("Failed to parse default network royalties PK: {err:?}"), + } + }; } lazy_static! {