safeAdd provides a safe sub method with lower overflow check for uint64.
(x, y *uint64)
| 34 | |
| 35 | // safeAdd provides a safe sub method with lower overflow check for uint64. |
| 36 | func safeSub(x, y *uint64) (err error) { |
| 37 | if *x < *y { |
| 38 | return ErrInsufficientBalance |
| 39 | } |
| 40 | *x -= *y |
| 41 | return |
| 42 | } |
| 43 | |
| 44 | type metaIndex struct { |
| 45 | accounts map[proto.AccountAddress]*types.Account |
no outgoing calls
no test coverage detected