mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 23:04:35 +01:00
Add basic arithmetic to Amount type
This commit is contained in:
committed by
Christian Decker
parent
09dfe3931d
commit
6abcb18145
@@ -78,6 +78,26 @@ impl Amount {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Add for Amount {
|
||||
type Output = Amount;
|
||||
|
||||
fn add(self, rhs: Self) -> Self::Output {
|
||||
Amount {
|
||||
msat: self.msat + rhs.msat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Sub for Amount {
|
||||
type Output = Amount;
|
||||
|
||||
fn sub(self, rhs: Self) -> Self::Output {
|
||||
Amount {
|
||||
msat: self.msat - rhs.msat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct ShortChannelId(u64);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user