From 6db81ee769b3275140b439e7dbc45daa0a6ab938 Mon Sep 17 00:00:00 2001 From: Sosthene00 <674694@protonmail.ch> Date: Thu, 21 Mar 2024 18:06:39 +0100 Subject: [PATCH] Add SilentPaymentWallet --- src/main.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main.rs b/src/main.rs index a55d23f..4e0c9b0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,6 +69,27 @@ impl MutexExt for Mutex { } } +#[derive(Debug)] +pub(crate) struct SilentPaymentWallet { + sp_client: Mutex, + sp_outputs: Mutex, + storage: Mutex, +} + +impl SilentPaymentWallet { + pub fn get_client(&self) -> Result> { + self.sp_client.lock_anyhow() + } + + pub fn get_outputs(&self) -> Result> { + self.sp_outputs.lock_anyhow() + } + + pub fn get_storage(&self) -> Result> { + self.storage.lock_anyhow() + } +} + enum BroadcastType { Sender(SocketAddr), ExcludeSender(SocketAddr),