| 306 | } |
| 307 | |
| 308 | WARN_UNUSED_RESULT bool amount_sat_add(struct amount_sat *val, |
| 309 | struct amount_sat a, |
| 310 | struct amount_sat b) |
| 311 | { |
| 312 | if (add_overflows_u64(a.satoshis, b.satoshis)) |
| 313 | return false; |
| 314 | |
| 315 | val->satoshis = a.satoshis + b.satoshis; |
| 316 | return true; |
| 317 | } |
| 318 | |
| 319 | WARN_UNUSED_RESULT bool amount_sat_sub(struct amount_sat *val, |
| 320 | struct amount_sat a, |