diff --git a/core/src/store.rs b/core/src/store.rs index 1b09873..20c25d1 100644 --- a/core/src/store.rs +++ b/core/src/store.rs @@ -453,6 +453,17 @@ impl Store { Ok(changed > 0) } + /// The acceptance state of an address, if it was ever accepted: + /// Some(true) main tier, Some(false) blocked, None never. + pub fn accepted_state(&self, address: &str) -> Result, Error> { + Ok(self + .one::( + "SELECT active FROM accepted WHERE address = ?1", + &[&address], + )? + .map(|active| active != 0)) + } + /// The identity frozen at acceptance, if this address is currently /// accepted; the token for our own mailbox travels in the next message. pub fn accepted_identity(&self, address: &str) -> Result, Error> {