amount: helper for msat == 0

Shorthand for checking if value is zero
This commit is contained in:
niftynei 2021-11-11 16:34:26 -06:00 committed by Rusty Russell
parent 43ade318d9
commit 5e1d8d6ad6
2 changed files with 6 additions and 0 deletions

View File

@ -360,6 +360,11 @@ bool amount_sat_zero(struct amount_sat a)
return a.satoshis == 0;
}
bool amount_msat_zero(struct amount_msat a)
{
return a.millisatoshis == 0;
}
bool amount_msat_eq(struct amount_msat a, struct amount_msat b)
{
return a.millisatoshis == b.millisatoshis;

View File

@ -94,6 +94,7 @@ bool amount_msat_eq(struct amount_msat a, struct amount_msat b);
/* Is a zero? */
bool amount_sat_zero(struct amount_sat a);
bool amount_msat_zero(struct amount_msat a);
/* Is a > b? */
bool amount_sat_greater(struct amount_sat a, struct amount_sat b);