Add SilentPaymentWallet

This commit is contained in:
Sosthene00 2024-03-21 18:06:39 +01:00
parent d33c3e9735
commit 6db81ee769

View File

@ -69,6 +69,27 @@ impl<T: Debug> MutexExt<T> for Mutex<T> {
} }
} }
#[derive(Debug)]
pub(crate) struct SilentPaymentWallet {
sp_client: Mutex<SpClient>,
sp_outputs: Mutex<OutputList>,
storage: Mutex<JsonFile>,
}
impl SilentPaymentWallet {
pub fn get_client(&self) -> Result<MutexGuard<SpClient>> {
self.sp_client.lock_anyhow()
}
pub fn get_outputs(&self) -> Result<MutexGuard<OutputList>> {
self.sp_outputs.lock_anyhow()
}
pub fn get_storage(&self) -> Result<MutexGuard<JsonFile>> {
self.storage.lock_anyhow()
}
}
enum BroadcastType { enum BroadcastType {
Sender(SocketAddr), Sender(SocketAddr),
ExcludeSender(SocketAddr), ExcludeSender(SocketAddr),