computer: store part 6

This commit is contained in:
nym21
2025-07-02 16:02:18 +02:00
parent 9810bc09e9
commit d10ac3f87b
52 changed files with 523 additions and 331 deletions

View File

@@ -19,16 +19,13 @@ impl AddressData {
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
if self.amount() == Sats::ZERO {
if self.outputs_len != 0 {
unreachable!();
}
pub fn has_0_sats(&self) -> bool {
self.amount() == Sats::ZERO
}
true
} else {
false
}
#[inline(always)]
pub fn has_0_utxos(&self) -> bool {
self.outputs_len == 0
}
pub fn receive(&mut self, amount: Sats, price: Option<Dollars>) {

View File

@@ -75,6 +75,10 @@ impl Timestamp {
}
}
}
pub fn is_more_than_hour(&self) -> bool {
jiff::Timestamp::from(*self).as_second() >= 60 * 60
}
}
impl From<u32> for Timestamp {