1. Make it the standard "return the error" pattern. 2. Rather than flags to indicate what types are allowed, have the callers check the return explicitly. 3. Document the APIs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>