From 0b7395be2ab9d67491ae8ba71b3e5ca51ae24d25 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sat, 11 Apr 2026 23:52:08 +0700 Subject: [PATCH] fix(dash-spv): remove overly-strict is_synced gate from broadcast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `dispatch_local` fix in #626 added a gate that rejected `broadcast_transaction` whenever `sync_progress().is_synced()` returned false. `is_synced()` requires *every* sync manager (headers / filter_headers / filters / blocks / masternodes) to be in `SyncState::Synced` simultaneously — any manager transitioning to `WaitForEvents` (e.g. the blocks manager briefly reacting to a new chain tip) flips the aggregate to "not synced" and blocks broadcasts. In end-to-end tests this manifested as intermittent `SpvBroadcastFailed { detail: "Client is not synced" }` errors in the middle of normal operation, hours after initial sync had completed. The gate served no purpose the underlying broadcast protocol doesn't already handle — peers themselves reject unfit-for-propagation txs. Drop it. --- dash-spv/src/client/transactions.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dash-spv/src/client/transactions.rs b/dash-spv/src/client/transactions.rs index 62dd580d1..0a903737a 100644 --- a/dash-spv/src/client/transactions.rs +++ b/dash-spv/src/client/transactions.rs @@ -1,6 +1,6 @@ //! Transaction-related client APIs (e.g., broadcasting) -use crate::error::{NetworkError, Result, SpvError, SyncError}; +use crate::error::{NetworkError, Result, SpvError}; use crate::network::NetworkManager; use crate::storage::StorageManager; use dashcore::network::message::NetworkMessage; @@ -16,10 +16,6 @@ impl /// The transaction is also injected into the local message pipeline so that /// the mempool manager processes it immediately. pub async fn broadcast_transaction(&self, tx: &dashcore::Transaction) -> Result<()> { - if !self.sync_progress().await.is_synced() { - return Err(SpvError::Sync(SyncError::NotSynced)); - } - let network_guard = self.network.lock().await; if network_guard.peer_count() == 0 {