recursively compare inputs when sorting tx, fixes #32