channel: support HTLC forwarding.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-04-27 15:38:50 +09:30
committed by Christian Decker
parent aa01b7d120
commit 778b756369
6 changed files with 314 additions and 36 deletions

View File

@@ -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 */