mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 14:54:26 +01:00
channel: support HTLC forwarding.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
aa01b7d120
commit
778b756369
10
overflows.h
10
overflows.h
@@ -21,4 +21,14 @@ static inline bool mul_overflows_s64(int64_t a, int64_t b)
|
||||
ret = a * b;
|
||||
return (ret / a != b);
|
||||
}
|
||||
|
||||
static inline bool mul_overflows_u64(uint64_t a, uint64_t b)
|
||||
{
|
||||
uint64_t ret;
|
||||
|
||||
if (a == 0)
|
||||
return false;
|
||||
ret = a * b;
|
||||
return (ret / a != b);
|
||||
}
|
||||
#endif /* LIGHTNING_OVERFLOWS_H */
|
||||
|
||||
Reference in New Issue
Block a user