From a2bb8ef6828feeb4f4b46132ccbec871b93e6eb8 Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Fri, 2 Feb 2024 15:40:55 +0200 Subject: [PATCH 1/2] restart tx fix --- base_layer/wallet/src/wallet.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/base_layer/wallet/src/wallet.rs b/base_layer/wallet/src/wallet.rs index a9263cf0b6..618cfb4e19 100644 --- a/base_layer/wallet/src/wallet.rs +++ b/base_layer/wallet/src/wallet.rs @@ -20,7 +20,7 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::{cmp, marker::PhantomData, sync::Arc}; +use std::{cmp, io, marker::PhantomData, sync::Arc, thread}; use blake2::Blake2b; use digest::consts::U32; @@ -283,13 +283,15 @@ where // made during comms startup. In the case of a Tor Transport the public address could // have been generated let _result = wallet_db.set_node_address(address); - let result = block_on(ts.restart_transaction_protocols()); - if result.is_err() { - warn!( + thread::spawn(move || { + let result = block_on(ts.restart_transaction_protocols()); + if result.is_err() { + warn!( target: LOG_TARGET, "Could not restart transaction negotiation protocols: {:?}", result ); - } + } + }); }; initialization::spawn_comms_using_transport(comms, config.p2p.transport, after_comms).await? } else { From b9eeba1d0d0d6526f9822b51d8e01d7279f8579f Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Fri, 2 Feb 2024 15:44:08 +0200 Subject: [PATCH 2/2] fmt --- base_layer/wallet/src/wallet.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base_layer/wallet/src/wallet.rs b/base_layer/wallet/src/wallet.rs index 618cfb4e19..28e2c3457f 100644 --- a/base_layer/wallet/src/wallet.rs +++ b/base_layer/wallet/src/wallet.rs @@ -20,7 +20,7 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::{cmp, io, marker::PhantomData, sync::Arc, thread}; +use std::{cmp, marker::PhantomData, sync::Arc, thread}; use blake2::Blake2b; use digest::consts::U32; @@ -287,9 +287,9 @@ where let result = block_on(ts.restart_transaction_protocols()); if result.is_err() { warn!( - target: LOG_TARGET, - "Could not restart transaction negotiation protocols: {:?}", result - ); + target: LOG_TARGET, + "Could not restart transaction negotiation protocols: {:?}", result + ); } }); };