Add SilentPaymentWallet
This commit is contained in:
parent
d33c3e9735
commit
6db81ee769
21
src/main.rs
21
src/main.rs
@ -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 {
|
||||
Sender(SocketAddr),
|
||||
ExcludeSender(SocketAddr),
|
||||
|
Loading…
x
Reference in New Issue
Block a user