| 275 | } |
| 276 | |
| 277 | WARN_UNUSED_RESULT bool amount_sat_add(struct amount_sat *val, |
| 278 | struct amount_sat a, |
| 279 | struct amount_sat b) |
| 280 | { |
| 281 | if (add_overflows_u64(a.satoshis, b.satoshis)) |
| 282 | return false; |
| 283 | |
| 284 | val->satoshis = a.satoshis + b.satoshis; |
| 285 | return true; |
| 286 | } |
| 287 | |
| 288 | WARN_UNUSED_RESULT bool amount_sat_sub(struct amount_sat *val, |
| 289 | struct amount_sat a, |