submitpackage requires the package to be topologically sorted with the child being the last element in the array, but this is not documented in the RPC method or the error messages.
Also sneaking in some other minor improvements that I found while going through the code:
- Informing the user that
packageneeds to be an array of length between1andMAX_PACKAGE_COUNTis confusing whenIsChildWithPackage()requires that the package size >= 2. Remove this check to avoid code duplication and sending a confusing error message. - fixups to the
submitpackageexamples